From fe605b9411bb4d0b1fd12395d0fb75d5b734141b Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 23 Oct 2012 18:12:59 +0200 Subject: [PATCH 001/109] * text.texi (Org Authoring): Change @ref to @pxref. --- doc/emacs/ChangeLog | 4 ++++ doc/emacs/text.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 90beb08233d..ecfbaf5fc77 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2012-10-23 Bastien Guerry + + * text.texi (Org Authoring): Change @ref to @pxref. + 2012-10-23 Stefan Monnier * custom.texi (Hooks): Clarify that -hooks is deprecated. diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index f10e78e17ad..e80c1b1cdc3 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -1399,7 +1399,7 @@ This is an example. #+end_example @end example - For further details, see @ref{Exporting,,,org, The Org Manual} and + For further details, @pxref{Exporting,,,org, The Org Manual}, and @ref{Publishing,,,org, The Org Manual}. @node TeX Mode From 7108f8e38a73bafbea34eafd385aba243fe56a37 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 23 Oct 2012 09:26:52 -0700 Subject: [PATCH 002/109] Remove NEWS markup so that file-attributes etc get rechecked --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 4fd7e13f8ca..27957e6787d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -853,7 +853,7 @@ in Emacs 24.1: *** `current-time-string' no longer requires that its argument's year must be in the range 1000..9999. It now works with any year supported by the underlying C implementation. ---- + *** `current-time' now returns extended-format time stamps (HIGH LOW USEC PSEC), where the new PSEC slot specifies picoseconds. PSEC is typically a multiple of 1000 on current machines. Other From d20d69c098377609caaafafbe98dc118ff8a6e77 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2012 12:57:31 -0400 Subject: [PATCH 003/109] * lisp/repeat.el (repeat): Set real-this-command. Fixes: debbugs:12232 --- lisp/ChangeLog | 2 ++ lisp/repeat.el | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 16c4983d385..593b2a935b7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-23 Stefan Monnier + * repeat.el (repeat): Set real-this-command (bug#12232). + * htmlfontify.el (hfy-post-html-hook): * filesets.el (filesets-cache-fill-content-hook): * arc-mode.el (archive-extract-hook): 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\"." (interactive) (let ((repeat-message-function fun)) (setq this-command 'repeat) + ;; Beware: messing with `real-this-command' is *bad*, but we + ;; need it so `last-repeatable-command' can be recognized + ;; later (bug#12232). + (setq real-this-command 'repeat) (call-interactively 'repeat)))))) map))))) From 76673f9c62bbc0016a1233f38be920959b1ea158 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2012 13:09:22 -0400 Subject: [PATCH 004/109] * checkdoc.el (checkdoc-comment-style-hooks): Typo. --- lisp/emacs-lisp/checkdoc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 location of end of the documentation string.") (define-obsolete-variable-alias 'checkdoc-comment-style-hooks - checkdoc-comment-style-functions "24.3") + 'checkdoc-comment-style-functions "24.3") (defvar checkdoc-comment-style-functions nil "Hook run after the standard comment style check is completed. Must return nil if no errors are found, or a string describing the From 4c77e620ecb1dc8ef5eb695133541812724bcea8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 23 Oct 2012 19:09:55 +0200 Subject: [PATCH 005/109] Update lib-src/makefile.w32-in to follow 2012-10-21T01:19:46Z!rgm@gnu.org. lib-src/makefile.w32-in (lisp2): Add cp51932.el and eucjp-ms.el, to follow src/lisp.mk. --- lib-src/ChangeLog | 5 +++++ lib-src/makefile.w32-in | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index bc0e5c9a3d2..c88b467ee29 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2012-10-23 Eli Zaretskii + + * makefile.w32-in (lisp2): Add cp51932.el and eucjp-ms.el, to + follow src/lisp.mk. + 2012-10-21 Glenn Morris * make-docfile.c (scan_lisp_file): Add cp51932.el and eucjp-ms.el. 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 = \ $(lispsource)language/greek.elc \ $(lispsource)language/hebrew.elc \ $(lispsource)language/japanese.elc \ + $(lispsource)international/cp51932.el \ + $(lispsource)international/eucjp-ms.el \ $(lispsource)language/korean.elc \ $(lispsource)language/lao.elc \ $(lispsource)language/cham.elc \ From ed68379ea9440ca254eef279047d2e9bfd175e5b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 23 Oct 2012 13:33:22 -0400 Subject: [PATCH 006/109] Revert 2012-10-21 Makefile.in change (bug#12713) * Makefile.in (emacs_transform): Remove. (install-man): Revert 2012-10-21 change. --- ChangeLog | 5 +++++ Makefile.in | 11 ++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 362c2adc2d8..1a2a80fe39c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-10-23 Glenn Morris + + * Makefile.in (emacs_transform): Remove. + (install-man): Revert 2012-10-21 change. (Bug#12713) + 2012-10-21 Glenn Morris * Makefile.in (install-etc): Don't install emacs22 icons. diff --git a/Makefile.in b/Makefile.in index d80496d8b7b..5c5d30fb63f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -631,17 +631,14 @@ install-man: done ## Install those items from etc/ that need to end up elsewhere. - -# Like EMACS, but without EXEEXT. -emacs_transform = `echo emacs | sed '$(TRANSFORM)'` - install-etc: umask 022; ${MKDIR_P} $(DESTDIR)${desktopdir} + dest=`echo emacs | sed '$(TRANSFORM)'`; \ tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \ - sed -e '/^Exec=emacs/ s/emacs/${emacs_transform}/' \ - -e '/^Icon=emacs/ s/emacs/${emacs_transform}/' \ + sed -e "/^Exec=emacs/ s/emacs/$${dest}/" \ + -e "/^Icon=emacs/ s/emacs/$${dest}/" \ ${srcdir}/etc/emacs.desktop > $${tmp}; \ - ${INSTALL_DATA} $${tmp} $(DESTDIR)${desktopdir}/${emacs_transform}.desktop; \ + ${INSTALL_DATA} $${tmp} $(DESTDIR)${desktopdir}/$${dest}.desktop; \ rm -f $${tmp} thisdir=`/bin/pwd`; \ cd ${iconsrcdir} || exit 1; umask 022 ; \ From a6709bc70c1ddde8f31c1470f06d39f67976d68d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 23 Oct 2012 13:49:24 -0400 Subject: [PATCH 007/109] * gud.el (gud-menu-map): Check gdb-active-process is bound. (Bug#12358) --- lisp/ChangeLog | 5 +++++ lisp/progmodes/gud.el | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 593b2a935b7..2d3bd095278 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-23 Glenn Morris + + * progmodes/gud.el (gud-menu-map): + Check gdb-active-process is bound. (Bug#12358) + 2012-10-23 Stefan Monnier * repeat.el (repeat): Set real-this-command (bug#12232). 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.") ([run] menu-item "Run" gud-run :enable (not gud-running) :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) - ([go] menu-item (if gdb-active-process "Continue" "Run") gud-go + ([go] menu-item (if (bound-and-true-p gdb-active-process) + "Continue" "Run") gud-go :visible (and (eq gud-minor-mode 'gdbmi) (gdb-show-run-p))) ([stop] menu-item "Stop" gud-stop-subjob @@ -178,7 +179,7 @@ Used to gray out relevant toolbar icons.") '(gdbmi gdb dbx xdb jdb pdb))) ([pp] menu-item "Print S-expression" gud-pp :enable (and (not gud-running) - gdb-active-process) + (bound-and-true-p gdb-active-process)) :visible (and (string-equal (buffer-local-value 'gud-target-name gud-comint-buffer) "emacs") From 9c3e39f3ff724fdd0e622a8fde608e6346991346 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2012 14:40:23 -0400 Subject: [PATCH 008/109] * lisp/vc/diff-mode.el (diff-hunk): `save-excursion' while refining. Fixes: debbugs:12671 --- lisp/ChangeLog | 5 +++++ lisp/vc/diff-mode.el | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2d3bd095278..05b7cfc176e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-23 Stefan Monnier + + * vc/diff-mode.el (diff-hunk): `save-excursion' while refining + (bug#12671). + 2012-10-23 Glenn Morris * progmodes/gud.el (gud-menu-map): diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 0e79c962b47..cdcc7ca4745 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -581,8 +581,9 @@ next hunk if TRY-HARDER is non-nil; otherwise signal an error." (with-local-quit (when (buffer-live-p buffer) (with-current-buffer buffer - (goto-char point) - (diff-refine-hunk)))))))))) + (save-excursion + (goto-char point) + (diff-refine-hunk))))))))))) (easy-mmode-define-navigation diff-file diff-file-header-re "file" diff-end-of-file) From c79825bd22f07399351d626fbc8060941aba36a5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2012 15:07:44 -0400 Subject: [PATCH 009/109] * lisp/progmodes/compile.el (compilation-start): Try to handle common quoting of `cd' argument. Fixes: debbugs:12640 --- lisp/ChangeLog | 3 +++ lisp/progmodes/compile.el | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05b7cfc176e..df7420c30a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-23 Stefan Monnier + * progmodes/compile.el (compilation-start): Try to handle common + quoting of `cd' argument (bug#12640). + * vc/diff-mode.el (diff-hunk): `save-excursion' while refining (bug#12671). 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." ;; Then evaluate a cd command if any, but don't perform it yet, else ;; start-command would do it again through the shell: (cd "..") AND ;; sh -c "cd ..; make" - (cd (if (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" - command) - (if (match-end 1) - (substitute-env-vars (match-string 1 command)) - "~") - default-directory)) + (cd (cond + ((not (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\|'[^']*'\\|\"\\(?:[^\"`$\\]\\|\\\\.\\)*\"\\)\\)?\\s *[;&\n]" + command)) + default-directory) + ((not (match-end 1)) "~") + ((eq (aref command (match-beginning 1)) ?\') + (substring command (1+ (match-beginning 1)) + (1- (match-end 1)))) + ((eq (aref command (match-beginning 1)) ?\") + (replace-regexp-in-string + "\\\\\\(.\\)" "\\1" + (substring command (1+ (match-beginning 1)) + (1- (match-end 1))))) + (t (substitute-env-vars (match-string 1 command))))) (erase-buffer) ;; Select the desired mode. (if (not (eq mode t)) From 7f8de58ca53c6a4f0844b244af2437b6d058723e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 23 Oct 2012 12:39:36 -0700 Subject: [PATCH 010/109] * configure.ac (_FORTIFY_SOURCE): Do not multiply define. This ports to Gentoo. Problem originally reported against coreutils, but Emacs has it too. Fixes: debbugs:12714 --- ChangeLog | 6 ++++++ configure.ac | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1a2a80fe39c..1d30382d34d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-10-23 Paul Eggert + + * configure.ac (_FORTIFY_SOURCE): Do not multiply define (Bug#12714). + This ports to Gentoo. Problem originally reported against coreutils, + but Emacs has it too. + 2012-10-23 Glenn Morris * Makefile.in (emacs_transform): Remove. diff --git a/configure.ac b/configure.ac index 7104b9de170..4564bc3085e 100644 --- a/configure.ac +++ b/configure.ac @@ -743,7 +743,7 @@ else AH_VERBATIM([FORTIFY_SOURCE], [/* Enable compile-time and run-time bounds-checking, and some warnings, without upsetting glibc 2.15+. */ - #if defined __OPTIMIZE__ && __OPTIMIZE__ + #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ # define _FORTIFY_SOURCE 2 #endif ]) From 9eadb1a9074d93464dfa4d97c22a791c4d76353f Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 23 Oct 2012 23:26:00 +0200 Subject: [PATCH 011/109] Fix last tiny change about text.texi. Thanks to Eli for his guidance. --- doc/emacs/ChangeLog | 3 ++- doc/emacs/text.texi | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index ecfbaf5fc77..9a71ed5b272 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,6 +1,7 @@ 2012-10-23 Bastien Guerry - * text.texi (Org Authoring): Change @ref to @pxref. + * text.texi (Org Authoring): Use a comma after @ref to avoid the + insertion of a period in the Info output. 2012-10-23 Stefan Monnier diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index e80c1b1cdc3..6e895d3ac3c 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -1399,7 +1399,7 @@ This is an example. #+end_example @end example - For further details, @pxref{Exporting,,,org, The Org Manual}, and + For further details, @ref{Exporting,,,org, The Org Manual}, and @ref{Publishing,,,org, The Org Manual}. @node TeX Mode From d92df117f9e0b4768b5d4d48db5261a950f57c0a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2012 23:18:32 -0400 Subject: [PATCH 012/109] * lisp/minibuffer.el (completion--all-sorted-completions-location): New var. (completion--cache-all-sorted-completions) (completion--flush-all-sorted-completions): Use it. (completion-in-region, completion-in-region--postch) (completion-at-point, completion-help-at-point): Use markers in completion-in-region--data. Fixes: debbugs:12619 --- lisp/ChangeLog | 9 ++++ lisp/minibuffer.el | 107 +++++++++++++++++++++++++-------------------- 2 files changed, 69 insertions(+), 47 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df7420c30a3..c84d0110fc7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2012-10-24 Stefan Monnier + + * minibuffer.el (completion--all-sorted-completions-location): New var. + (completion--cache-all-sorted-completions) + (completion--flush-all-sorted-completions): Use it. + (completion-in-region, completion-in-region--postch) + (completion-at-point, completion-help-at-point): Use markers in + completion-in-region--data (bug#12619). + 2012-10-23 Stefan Monnier * progmodes/compile.el (compilation-start): Try to handle common diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index f865a0269d4..3f9ec339c78 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -871,6 +871,7 @@ completion candidates than this number." (defvar completion-all-sorted-completions nil) (make-variable-buffer-local 'completion-all-sorted-completions) +(defvar-local completion--all-sorted-completions-location nil) (defvar completion-cycling nil) (defvar completion-fail-discreetly nil @@ -1048,14 +1049,19 @@ scroll the window of possible completions." (defun completion--cache-all-sorted-completions (comps) (add-hook 'after-change-functions - 'completion--flush-all-sorted-completions nil t) + 'completion--flush-all-sorted-completions nil t) + (setq completion--all-sorted-completions-location + (cons (copy-marker (field-beginning)) (copy-marker (field-end)))) (setq completion-all-sorted-completions comps)) -(defun completion--flush-all-sorted-completions (&rest _ignore) - (remove-hook 'after-change-functions - 'completion--flush-all-sorted-completions t) - (setq completion-cycling nil) - (setq completion-all-sorted-completions nil)) +(defun completion--flush-all-sorted-completions (&rest start end len) + (unless (and start end + (or (> start (cdr completion--all-sorted-completions-location)) + (< end (car completion--all-sorted-completions-location)))) + (remove-hook 'after-change-functions + 'completion--flush-all-sorted-completions t) + (setq completion-cycling nil) + (setq completion-all-sorted-completions nil))) (defun completion--metadata (string base md-at-point table pred) ;; Like completion-metadata, but for the specific case of getting the @@ -1758,7 +1764,10 @@ exit." (when completion-in-region-mode-predicate (completion-in-region-mode 1) (setq completion-in-region--data - (list (current-buffer) start end collection))) + (list (if (markerp start) start (copy-marker start)) + (copy-marker end) collection))) + ;; FIXME: `minibuffer-complete' should call `completion-in-region' rather + ;; than the other way around! (unwind-protect (call-interactively 'minibuffer-complete) (delete-overlay ol))))) @@ -1782,12 +1791,12 @@ exit." (or unread-command-events ;Don't pop down the completions in the middle of ;mouse-drag-region/mouse-set-point. (and completion-in-region--data - (and (eq (car completion-in-region--data) + (and (eq (marker-buffer (nth 0 completion-in-region--data)) (current-buffer)) - (>= (point) (nth 1 completion-in-region--data)) + (>= (point) (nth 0 completion-in-region--data)) (<= (point) (save-excursion - (goto-char (nth 2 completion-in-region--data)) + (goto-char (nth 1 completion-in-region--data)) (line-end-position))) (funcall completion-in-region-mode--predicate))) (completion-in-region-mode -1))) @@ -1892,17 +1901,19 @@ The completion method is determined by `completion-at-point-functions'." (let ((res (run-hook-wrapped 'completion-at-point-functions #'completion--capf-wrapper 'all))) (pcase res - (`(,_ . ,(and (pred functionp) f)) (funcall f)) - (`(,hookfun . (,start ,end ,collection . ,plist)) - (let* ((completion-extra-properties plist) - (completion-in-region-mode-predicate - (lambda () - ;; We're still in the same completion field. - (eq (car-safe (funcall hookfun)) start)))) - (completion-in-region start end collection - (plist-get plist :predicate)))) - ;; Maybe completion already happened and the function returned t. - (_ (cdr res))))) + (`(,_ . ,(and (pred functionp) f)) (funcall f)) + (`(,hookfun . (,start ,end ,collection . ,plist)) + (unless (markerp start) (setq start (copy-marker start))) + (let* ((completion-extra-properties plist) + (completion-in-region-mode-predicate + (lambda () + ;; We're still in the same completion field. + (let ((newstart (car-safe (funcall hookfun)))) + (and newstart (= newstart start)))))) + (completion-in-region start end collection + (plist-get plist :predicate)))) + ;; Maybe completion already happened and the function returned t. + (_ (cdr res))))) (defun completion-help-at-point () "Display the completions on the text around point. @@ -1914,32 +1925,34 @@ The completion method is determined by `completion-at-point-functions'." (pcase res (`(,_ . ,(and (pred functionp) f)) (message "Don't know how to show completions for %S" f)) - (`(,hookfun . (,start ,end ,collection . ,plist)) - (let* ((minibuffer-completion-table collection) - (minibuffer-completion-predicate (plist-get plist :predicate)) - (completion-extra-properties plist) - (completion-in-region-mode-predicate - (lambda () - ;; We're still in the same completion field. - (eq (car-safe (funcall hookfun)) start))) - (ol (make-overlay start end nil nil t))) - ;; FIXME: We should somehow (ab)use completion-in-region-function or - ;; introduce a corresponding hook (plus another for word-completion, - ;; and another for force-completion, maybe?). - (overlay-put ol 'field 'completion) - (overlay-put ol 'priority 100) - (completion-in-region-mode 1) - (setq completion-in-region--data - (list (current-buffer) start end collection)) - (unwind-protect - (call-interactively 'minibuffer-completion-help) - (delete-overlay ol)))) - (`(,hookfun . ,_) - ;; The hook function already performed completion :-( - ;; Not much we can do at this point. - (message "%s already performed completion!" hookfun) - nil) - (_ (message "Nothing to complete at point"))))) + (`(,hookfun . (,start ,end ,collection . ,plist)) + (unless (markerp start) (setq start (copy-marker start))) + (let* ((minibuffer-completion-table collection) + (minibuffer-completion-predicate (plist-get plist :predicate)) + (completion-extra-properties plist) + (completion-in-region-mode-predicate + (lambda () + ;; We're still in the same completion field. + (let ((newstart (car-safe (funcall hookfun)))) + (and newstart (= newstart start))))) + (ol (make-overlay start end nil nil t))) + ;; FIXME: We should somehow (ab)use completion-in-region-function or + ;; introduce a corresponding hook (plus another for word-completion, + ;; and another for force-completion, maybe?). + (overlay-put ol 'field 'completion) + (overlay-put ol 'priority 100) + (completion-in-region-mode 1) + (setq completion-in-region--data + (list start (copy-marker end) collection)) + (unwind-protect + (call-interactively 'minibuffer-completion-help) + (delete-overlay ol)))) + (`(,hookfun . ,_) + ;; The hook function already performed completion :-( + ;; Not much we can do at this point. + (message "%s already performed completion!" hookfun) + nil) + (_ (message "Nothing to complete at point"))))) ;;; Key bindings. From 5c78877693213f57d4d0a079fd9554c46eb35c6f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2012 23:22:21 -0400 Subject: [PATCH 013/109] * minibuffer.el (completion--flush-all-sorted-completions): Fix typo. Fixes: debbugs:12619 --- lisp/minibuffer.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 3f9ec339c78..27050042b83 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1054,7 +1054,7 @@ scroll the window of possible completions." (cons (copy-marker (field-beginning)) (copy-marker (field-end)))) (setq completion-all-sorted-completions comps)) -(defun completion--flush-all-sorted-completions (&rest start end len) +(defun completion--flush-all-sorted-completions (&optional start end _len) (unless (and start end (or (> start (cdr completion--all-sorted-completions-location)) (< end (car completion--all-sorted-completions-location)))) From 75e8f9d2decbbebf7ffc20d17ff8676077071255 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 24 Oct 2012 11:48:50 +0800 Subject: [PATCH 014/109] Improve documentation of easy-menu-define. * lisp/emacs-lisp/easymenu.el (easy-menu-define): Doc fix. * doc/lispref/keymaps.texi (Toolkit Differences): Node deleted. (Easy Menu): New node. Fixes: debbugs:12628 --- doc/lispref/ChangeLog | 5 ++ doc/lispref/elisp.texi | 9 +- doc/lispref/keymaps.texi | 168 ++++++++++++++++++++++++++++-------- lisp/ChangeLog | 4 + lisp/emacs-lisp/easymenu.el | 147 +++++++++++++++---------------- 5 files changed, 213 insertions(+), 120 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 26765e7a384..9142ef49b12 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-10-24 Chong Yidong + + * keymaps.texi (Toolkit Differences): Node deleted. + (Easy Menu): New node. + 2012-10-23 Stefan Monnier * hooks.texi (Standard Hooks): Clarify that -hooks is deprecated. diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index d46cb071bf7..1d1dab8faac 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -800,17 +800,14 @@ Menu Keymaps * Menu Bar:: How to customize the menu bar. * Tool Bar:: A tool bar is a row of images. * Modifying Menus:: How to add new items to a menu. +* Easy Menu:: A convenience macro for defining menus. Defining Menus -* Simple Menu Items:: A simple kind of menu key binding, - limited in capabilities. -* Extended Menu Items:: More powerful menu item definitions - let you specify keywords to enable - various features. +* Simple Menu Items:: A simple kind of menu key binding. +* Extended Menu Items:: More complex menu item definitions. * Menu Separators:: Drawing a horizontal line through a menu. * Alias Menu Items:: Using command aliases in menu items. -* Toolkit Differences:: Not all toolkits provide the same features. Major and Minor Modes diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 9fa6193a804..8fe729d50f2 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1963,13 +1963,14 @@ is active for the next input event, that activates the keyboard menu feature. @menu -* Defining Menus:: How to make a keymap that defines a menu. -* Mouse Menus:: How users actuate the menu with the mouse. -* Keyboard Menus:: How users actuate the menu with the keyboard. -* Menu Example:: Making a simple menu. -* Menu Bar:: How to customize the menu bar. -* Tool Bar:: A tool bar is a row of images. -* Modifying Menus:: How to add new items to a menu. +* Defining Menus:: How to make a keymap that defines a menu. +* Mouse Menus:: How users actuate the menu with the mouse. +* Keyboard Menus:: How users actuate the menu with the keyboard. +* Menu Example:: Making a simple menu. +* Menu Bar:: How to customize the menu bar. +* Tool Bar:: A tool bar is a row of images. +* Modifying Menus:: How to add new items to a menu. +* Easy Menu:: A convenience macro for making menus. @end menu @node Defining Menus @@ -2015,17 +2016,12 @@ an existing menu, you can specify its position in the menu using @code{define-key-after} (@pxref{Modifying Menus}). @menu -* Simple Menu Items:: A simple kind of menu key binding, - limited in capabilities. -* Extended Menu Items:: More powerful menu item definitions - let you specify keywords to enable - various features. +* Simple Menu Items:: A simple kind of menu key binding. +* Extended Menu Items:: More complex menu item definitions. * Menu Separators:: Drawing a horizontal line through a menu. * Alias Menu Items:: Using command aliases in menu items. -* Toolkit Differences:: Not all toolkits provide the same features. @end menu - @node Simple Menu Items @subsubsection Simple Menu Items @@ -2312,28 +2308,6 @@ itself). To request this, give the alias symbol a non-@code{nil} causes menu items for @code{make-read-only} and @code{make-writable} to show the keyboard bindings for @code{read-only-mode}. -@node Toolkit Differences -@subsubsection Toolkit Differences - -The various toolkits with which you can build Emacs do not all support -the same set of features for menus. Some code works as expected with -one toolkit, but not under another. - -One example is menu actions or buttons in a top-level menu bar. The -following works with the Lucid toolkit or on MS Windows, but not with -GTK or Nextstep, where clicking on the item has no effect. - -@example -(defun menu-action-greet () - (interactive) - (message "Hello Emacs User!")) - -(defun top-level-menu () - (interactive) - (define-key lisp-interaction-mode-map [menu-bar m] - '(menu-item "Action Button" menu-action-greet))) -@end example - @node Mouse Menus @subsection Menus and the Mouse @@ -2813,3 +2787,125 @@ menu of Shell mode, after the item @code{break}: [work] '("Work" . work-command) 'break) @end example @end defun + +@node Easy Menu +@subsection Easy Menu + + The following macro provides a convenient way to define pop-up menus +and/or menu bar menus. + +@defmac easy-menu-define symbol maps doc menu +This macro defines a pop-up menu and/or menu bar submenu, whose +contents are given by @var{menu}. + +If @var{symbol} is non-@code{nil}, it should be a symbol; then this +macro defines @var{symbol} as a function for popping up the menu +(@pxref{Pop-Up Menus}), with @var{doc} as its documentation string. +@var{symbol} should not be quoted. + +Regardless of the value of @var{symbol}, if @var{maps} is a keymap, +the menu is added to that keymap, as a top-level menu for the menu bar +(@pxref{Menu Bar}). It can also be a list of keymaps, in which case +the menu is added separately to each of those keymaps. + +The first element of @var{menu} must be a string, which serves as the +menu label. It may be followed by any number of the following +keyword-argument pairs: + +@table @code +@item :filter @var{function} +@var{function} must be a function which, if called with one +argument---the list of the other menu items---returns the actual items +to be displayed in the menu. + +@item :visible @var{include} +@var{include} is an expression; if it evaluates to @code{nil}, the +menu is made invisible. @code{:included} is an alias for +@code{:visible}. + +@item :active @var{enable} +@var{enable} is an expression; if it evaluates to @code{nil}, the menu +is not selectable. @code{:enable} is an alias for @code{:active}. +@end table + +The remaining elements in @var{menu} are menu items. + +A menu item can be a vector of three elements, @code{[@var{name} +@var{callback} @var{enable}]}. @var{name} is the menu item name (a +string). @var{callback} is a command to run, or an expression to +evaluate, when the item is chosen. @var{enable} is an expression; if +it evaluates to @code{nil}, the item is disabled for selection. + +Alternatively, a menu item may have the form: + +@smallexample + [ @var{name} @var{callback} [ @var{keyword} @var{arg} ]... ] +@end smallexample + +@noindent +where @var{name} and @var{callback} have the same meanings as above, +and each optional @var{keyword} and @var{arg} pair should be one of +the following: + +@table @code +@item :keys @var{keys} +@var{keys} is a keyboard equivalent to the menu item (a string). This +is normally not needed, as keyboard equivalents are computed +automatically. @var{keys} is expanded with +@code{substitute-command-keys} before it is displayed (@pxref{Keys in +Documentation}). + +@item :key-sequence @var{keys} +@var{keys} is a hint for speeding up Emacs's first display of the +menu. It should be nil if you know that the menu item has no keyboard +equivalent; otherwise it should be a string or vector specifying a +keyboard equivalent for the menu item. + +@item :active @var{enable} +@var{enable} is an expression; if it evaluates to @code{nil}, the item +is make unselectable.. @code{:enable} is an alias for @code{:active}. + +@item :visible @var{include} +@var{include} is an expression; if it evaluates to @code{nil}, the +item is made invisible. @code{:included} is an alias for +@code{:visible}. + +@item :label @var{form} +@var{form} is an expression that is evaluated to obtain a value which +serves as the menu item's label (the default is @var{name}). + +@item :suffix @var{form} +@var{form} is an expression that is dynamically evaluated and whose +value is concatenated with the menu entry's label. + +@item :style @var{style} +@var{style} is a symbol describing the type of menu item; it should be +@code{toggle} (a checkbox), or @code{radio} (a radio button), or +anything else (meaning an ordinary menu item). + +@item :selected @var{selected} +@var{selected} is an expression; the checkbox or radio button is +selected whenever the expression's value is non-nil. + +@item :help @var{help} +@var{help} is a string describing the menu item. +@end table + +Alternatively, a menu item can be a string. Then that string appears +in the menu as unselectable text. A string consisting of dashes is +displayed as a separator (@pxref{Menu Separators}). + +Alternatively, a menu item can be a list with the same format as +@var{menu}. This is a submenu. +@end defmac + +Here is an example of using @code{easy-menu-define} to define a menu +similar to the one defined in the example in @ref{Menu Bar}: + +@example +(easy-menu-define words-menu global-map + "Menu for word navigation commands." + '("Words" + ["Forward word" forward-word] + ["Backward word" backward-word])) +@end example diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c84d0110fc7..5b709c76c74 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-24 Chong Yidong + + * emacs-lisp/easymenu.el (easy-menu-define): Doc fix (Bug#12628). + 2012-10-24 Stefan Monnier * minibuffer.el (completion--all-sorted-completions-location): New var. 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.") ;;;###autoload (defmacro easy-menu-define (symbol maps doc menu) - "Define a menu bar submenu in maps MAPS, according to MENU. + "Define a pop-up menu and/or menu bar menu specified by MENU. +If SYMBOL is non-nil, define SYMBOL as a function to pop up the +submenu defined by MENU, with DOC as its doc string. -If SYMBOL is non-nil, store the menu keymap in the value of SYMBOL, -and define SYMBOL as a function to pop up the menu, with DOC as its doc string. -If SYMBOL is nil, just store the menu keymap into MAPS. +MAPS, if non-nil, should be a keymap or a list of keymaps; add +the submenu defined by MENU to the keymap or each of the keymaps, +as a top-level menu bar item. -The first element of MENU must be a string. It is the menu bar item name. -It may be followed by the following keyword argument pairs +The first element of MENU must be a string. It is the menu bar +item name. It may be followed by the following keyword argument +pairs: - :filter FUNCTION + :filter FUNCTION + FUNCTION must be a function which, if called with one + argument---the list of the other menu items---returns the + items to actually display. -FUNCTION is a function with one argument, the rest of menu items. -It returns the remaining items of the displayed menu. + :visible INCLUDE + INCLUDE is an expression. The menu is visible if the + expression evaluates to a non-nil value. `:included' is an + alias for `:visible'. - :visible INCLUDE + :active ENABLE + ENABLE is an expression. The menu is enabled for selection + if the expression evaluates to a non-nil value. `:enable' is + an alias for `:active'. -INCLUDE is an expression; this menu is only visible if this -expression has a non-nil value. `:included' is an alias for `:visible'. +The rest of the elements in MENU are menu items. +A menu item can be a vector of three elements: - :active ENABLE - -ENABLE is an expression; the menu is enabled for selection whenever -this expression's value is non-nil. `:enable' is an alias for `:active'. - -The rest of the elements in MENU, are menu items. - -A menu item is usually a vector of three elements: [NAME CALLBACK ENABLE] + [NAME CALLBACK ENABLE] NAME is a string--the menu item name. -CALLBACK is a command to run when the item is chosen, -or a list to evaluate when the item is chosen. +CALLBACK is a command to run when the item is chosen, or an +expression to evaluate when the item is chosen. -ENABLE is an expression; the item is enabled for selection -whenever this expression's value is non-nil. +ENABLE is an expression; the item is enabled for selection if the +expression evaluates to a non-nil value. Alternatively, a menu item may have the form: - [ NAME CALLBACK [ KEYWORD ARG ] ... ] + [ NAME CALLBACK [ KEYWORD ARG ]... ] -Where KEYWORD is one of the symbols defined below. +where NAME and CALLBACK have the same meanings as above, and each +optional KEYWORD and ARG pair should be one of the following: - :keys KEYS + :keys KEYS + KEYS is a string; a keyboard equivalent to the menu item. + This is normally not needed because keyboard equivalents are + usually computed automatically. KEYS is expanded with + `substitute-command-keys' before it is used. -KEYS is a string; a complex keyboard equivalent to this menu item. -This is normally not needed because keyboard equivalents are usually -computed automatically. -KEYS is expanded with `substitute-command-keys' before it is used. + :key-sequence KEYS + KEYS is a hint for speeding up Emacs's first display of the + menu. It should be nil if you know that the menu item has no + keyboard equivalent; otherwise it should be a string or + vector specifying a keyboard equivalent for the menu item. - :key-sequence KEYS + :active ENABLE + ENABLE is an expression; the item is enabled for selection + whenever this expression's value is non-nil. `:enable' is an + alias for `:active'. -KEYS is nil, a string or a vector; nil or a keyboard equivalent to this -menu item. -This is a hint that will considerably speed up Emacs's first display of -a menu. Use `:key-sequence nil' when you know that this menu item has no -keyboard equivalent. + :visible INCLUDE + INCLUDE is an expression; this item is only visible if this + expression has a non-nil value. `:included' is an alias for + `:visible'. - :active ENABLE + :label FORM + FORM is an expression that is dynamically evaluated and whose + value serves as the menu item's label (the default is NAME). -ENABLE is an expression; the item is enabled for selection whenever -this expression's value is non-nil. `:enable' is an alias for `:active'. + :suffix FORM + FORM is an expression that is dynamically evaluated and whose + value is concatenated with the menu entry's label. - :visible INCLUDE + :style STYLE + STYLE is a symbol describing the type of menu item; it should + be `toggle' (a checkbox), or `radio' (a radio button), or any + other value (meaning an ordinary menu item). -INCLUDE is an expression; this item is only visible if this -expression has a non-nil value. `:included' is an alias for `:visible'. + :selected SELECTED + SELECTED is an expression; the checkbox or radio button is + selected whenever the expression's value is non-nil. - :label FORM + :help HELP + HELP is a string, the help to display for the menu item. -FORM is an expression that will be dynamically evaluated and whose -value will be used for the menu entry's text label (the default is NAME). +Alternatively, a menu item can be a string. Then that string +appears in the menu as unselectable text. A string consisting +solely of dashes is displayed as a menu separator. - :suffix FORM - -FORM is an expression that will be dynamically evaluated and whose -value will be concatenated to the menu entry's label. - - :style STYLE - -STYLE is a symbol describing the type of menu item. The following are -defined: - -toggle: A checkbox. - Prepend the name with `(*) ' or `( ) ' depending on if selected or not. -radio: A radio button. - Prepend the name with `[X] ' or `[ ] ' depending on if selected or not. -button: Surround the name with `[' and `]'. Use this for an item in the - menu bar itself. -anything else means an ordinary menu item. - - :selected SELECTED - -SELECTED is an expression; the checkbox or radio button is selected -whenever this expression's value is non-nil. - - :help HELP - -HELP is a string, the help to display for the menu item. - -A menu item can be a string. Then that string appears in the menu as -unselectable text. A string consisting solely of hyphens is displayed -as a solid horizontal line. - -A menu item can be a list with the same format as MENU. This is a submenu." +Alternatively, a menu item can be a list with the same format as +MENU. This is a submenu." (declare (indent defun) (debug (symbolp body))) `(progn ,(if symbol `(defvar ,symbol nil ,doc)) From 72ec96fb41e2e53ac5fda7532b0d3753e5ff971e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 24 Oct 2012 05:12:23 +0000 Subject: [PATCH 015/109] Update manual for new time stamp format. These instances were missed the first time around. Problem reported by Glenn Morris in . * doc/lispintro/emacs-lisp-intro.texi (Files List): * doc/lispref/buffers.texi (Modification Time): * doc/lispref/files.texi (Testing Accessibility, File Attributes): * doc/lispref/intro.texi (Version Info): * doc/lispref/os.texi (Time of Day): * doc/misc/emacs-mime.texi (time-date): Update for new time stamp format (HIGH LOW MICROSEC PICOSEC). * doc/misc/emacs-mime.texi (time-date): Also, fix bogus time stamp and modernize a bit. --- doc/lispintro/ChangeLog | 5 +++++ doc/lispintro/emacs-lisp-intro.texi | 14 +++++++------- doc/lispref/ChangeLog | 11 +++++++++++ doc/lispref/buffers.texi | 9 ++++----- doc/lispref/files.texi | 24 ++++++++++++------------ doc/lispref/intro.texi | 4 ++-- doc/lispref/os.texi | 2 +- doc/misc/ChangeLog | 6 ++++++ doc/misc/emacs-mime.texi | 10 +++++----- 9 files changed, 53 insertions(+), 32 deletions(-) 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 @@ +2012-10-24 Paul Eggert + + * emacs-lisp-intro.texi (Files List): + Update manual for new time stamp format (Bug#12706). + 2012-10-17 Gregor Zattler (tiny change) * 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/}@* a division of the @hfill email: @email{sales@@fsf.org}@* Free Software Foundation, Inc. @hfill Tel: +1 (617) 542-5942@* 51 Franklin Street, Fifth Floor @hfill Fax: +1 (617) 542-2652@* -Boston, MA 02110-1301 USA +Boston, MA 02110-1301 USA @end iftex @ifnottex @@ -249,7 +249,7 @@ GNU Press, http://www.fsf.org/campaigns/gnu-press/ a division of the email: sales@@fsf.org Free Software Foundation, Inc. Tel: +1 (617) 542-5942 51 Franklin Street, Fifth Floor Fax: +1 (617) 542-2652 -Boston, MA 02110-1301 USA +Boston, MA 02110-1301 USA @end example @end ifnottex @@ -15680,11 +15680,11 @@ nil 100 @end group @group -(17733 259) -(17491 28834) -(17596 62124) -13157 -"-rw-rw-r--" +(20615 27034 579989 697000) +(17905 55681 0 0) +(20615 26327 734791 805000) +13188 +"-rw-r--r--" @end group @group nil diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 9142ef49b12..bed74bb688a 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,14 @@ +2012-10-24 Paul Eggert + + Update manual for new time stamp format (Bug#12706). + * buffers.texi (Modification Time): + * files.texi (Testing Accessibility, File Attributes): + * intro.texi (Version Info): + * os.texi (Time of Day): + Update for new time stamp format (HIGH LOW MICROSEC PICOSEC). + These instances were missed the first time around. + Problem reported by Glenn Morris in . + 2012-10-24 Chong Yidong * keymaps.texi (Toolkit Differences): Node deleted. 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. @c Emacs 19 feature @defun visited-file-modtime This function returns the current buffer's recorded last file -modification time, as a list of the form @code{(@var{high} @var{low})}. +modification time, as a list of the form @code{(@var{high} @var{low} +@var{microsec} @var{picosec})}. (This is the same format that @code{file-attributes} uses to return time values; see @ref{File Attributes}.) @@ -664,9 +665,8 @@ is not @code{nil}, and otherwise to the last modification time of the visited file. If @var{time} is neither @code{nil} nor zero, it should have the form -@code{(@var{high} . @var{low})} or @code{(@var{high} @var{low})}, in -either case containing two integers, each of which holds 16 bits of the -time. +@code{(@var{high} @var{low} @var{microsec} @var{picosec})}, +the format used by @code{current-time} (@pxref{Time of Day}). This function is useful if the buffer was not read from the file 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. @defun gap-size This function returns the current gap size of the current buffer. @end defun - 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 @end example You can use @code{file-attributes} to get a file's last modification -time as a list of two numbers. @xref{File Attributes}. +time as a list of four integers. @xref{File Attributes}. @end defun @node Kinds of Files @@ -1228,11 +1228,11 @@ so this time will always hold the midnight of the day of last access. @cindex modification time of file @item -The time of last modification as a list of two integers (as above). +The time of last modification as a list of four integers (as above). This is the last time when the file's contents were modified. @item -The time of last status change as a list of two integers (as above). +The time of last status change as a list of four integers (as above). This is the time of the last change to the file's access mode bits, its owner and group, and other information recorded in the filesystem for the file, beyond the file's contents. @@ -1275,9 +1275,9 @@ For example, here are the file attributes for @file{files.texi}: @group (file-attributes "files.texi" 'string) @result{} (nil 1 "lh" "users" - (19145 42977) - (19141 59576) - (18340 17300) + (20614 64019 50040 152000) + (20000 23 0 0) + (20614 64555 902289 872000) 122295 "-rw-rw-rw-" nil (5888 2 . 43978) (15479 . 46724)) @@ -1301,14 +1301,14 @@ is owned by the user with name "lh". @item "users" is in the group with name "users". -@item (19145 42977) -was last accessed on Oct 5 2009, at 10:01:37. +@item (20614 64019 50040 152000) +was last accessed on October 23, 2012, at 20:12:03.050040152 UTC. -@item (19141 59576) -last had its contents modified on Oct 2 2009, at 13:49:12. +@item (20000 23 0 0) +was last modified on July 15, 2001, at 08:53:43 UTC. -@item (18340 17300) -last had its status changed on Feb 2 2008, at 12:19:00. +@item (20614 64555 902289 872000) +last had its status changed on October 23, 2012, at 20:20:59.902289872 UTC. @item 122295 is 122295 bytes long. (It may not contain 122295 characters, though, 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}. @defvar emacs-build-time The value of this variable indicates the time at which Emacs was -built. It is a list of three integers, like the value of +built. It is a list of four integers, like the value of @code{current-time} (@pxref{Time of Day}). @example @group emacs-build-time - @result{} (18846 52016 156039) + @result{} (20614 63694 515336 438000) @end group @end example @end defvar 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 the number of picoseconds from the start of that microsecond to the specified time. - The return value of @code{current-time} represents time using three + The return value of @code{current-time} represents time using four integers, as do the timestamps in the return value of @code{file-attributes} (@pxref{Definition of file-attributes}). In function arguments, e.g.@: the @var{time-value} diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index cda4f272ca2..5535fdd77f0 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,9 @@ +2012-10-24 Paul Eggert + + Update manual for new time stamp format (Bug#12706). + * emacs-mime.texi (time-date): Update for new format. + Also, fix bogus time stamp and modernize a bit. + 2012-10-23 Glenn Morris * cl.texi: Include emacsver.texi. Use Emacs version number rather 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: @result{} 905595714.0 (seconds-to-time 905595714.0) -@result{} (13818 19266 0) +@result{} (13818 19266 0 0) (time-to-days '(13818 19266)) @result{} 729644 (days-to-time 729644) -@result{} (961933 65536) +@result{} (961933 512) (time-since '(13818 19266)) -@result{} (0 430) +@result{} (6797 9607 984839 247000) (time-less-p '(13818 19266) '(13818 19145)) @result{} nil @@ -1546,7 +1546,7 @@ Here's a bunch of time/date/second/day examples: (time-to-number-of-days (time-since (date-to-time "Mon, 01 Jan 2001 02:22:26 GMT"))) -@result{} 4.146122685185185 +@result{} 4314.095589286675 @end example 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 12:21:54 1998 +0200"}. @item time -An internal Emacs time. For instance: @code{(13818 26466)}. +An internal Emacs time. For instance: @code{(13818 26466 0 0)}. @item seconds A floating point representation of the internal Emacs time. For From 39a58b5b51a881b4960600814653c3efd8e1ffb9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Oct 2012 00:41:11 -0700 Subject: [PATCH 016/109] Further namespace updates for cl.texi * doc/misc/cl.texi (Basic Setf, Macros, Declarations, Symbols, Numbers) (Sequences, Lists, Structures, Assertions, Efficiency Concerns) (Efficiency Concerns, Efficiency Concerns) (Common Lisp Compatibility, Old CL Compatibility): Further updates for cl-lib namespace. --- doc/misc/ChangeLog | 8 + doc/misc/cl.texi | 1131 ++++++++++++++++++++++---------------------- 2 files changed, 575 insertions(+), 564 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 5535fdd77f0..76859e09d42 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,11 @@ +2012-10-24 Glenn Morris + + * cl.texi (Basic Setf, Macros, Declarations, Symbols, Numbers) + (Sequences, Lists, Structures, Assertions, Efficiency Concerns) + (Efficiency Concerns, Efficiency Concerns) + (Common Lisp Compatibility, Old CL Compatibility): + Further updates for cl-lib namespace. + 2012-10-24 Paul Eggert Update manual for new time stamp format (Bug#12706). diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 12fd76e2e1c..5908e94be02 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -1047,11 +1047,11 @@ The @code{setf} macro takes care to evaluate all subforms in the proper left-to-right order; for example, @example -(setf (aref vec (incf i)) i) +(setf (aref vec (cl-incf i)) i) @end example @noindent -looks like it will evaluate @code{(incf i)} exactly once, before the +looks like it will evaluate @code{(cl-incf i)} exactly once, before the following access to @code{i}; the @code{setf} expander will insert temporary variables as necessary to ensure that it does in fact work this way no matter what setf-method is defined for @code{aref}. @@ -1081,7 +1081,7 @@ This package defines a number of other macros besides @code{setf} that operate on generalized variables. Many are interesting and useful even when the @var{place} is just a variable name. -@defspec psetf [place form]@dots{} +@defspec cl-psetf [place form]@dots{} This macro is to @code{setf} what @code{cl-psetq} is to @code{setq}: When several @var{place}s and @var{form}s are involved, the assignments take place in parallel rather than sequentially. @@ -1089,17 +1089,17 @@ Specifically, all subforms are evaluated from left to right, then all the assignments are done (in an undefined order). @end defspec -@defspec incf place &optional x +@defspec cl-incf place &optional x This macro increments the number stored in @var{place} by one, or by @var{x} if specified. The incremented value is returned. For -example, @code{(incf i)} is equivalent to @code{(setq i (1+ i))}, and -@code{(incf (car x) 2)} is equivalent to @code{(setcar x (+ (car x) 2))}. +example, @code{(cl-incf i)} is equivalent to @code{(setq i (1+ i))}, and +@code{(cl-incf (car x) 2)} is equivalent to @code{(setcar x (+ (car x) 2))}. Once again, care is taken to preserve the ``apparent'' order of evaluation. For example, @example -(incf (aref vec (incf i))) +(cl-incf (aref vec (cl-incf i))) @end example @noindent @@ -1109,27 +1109,27 @@ does, which means the above form is @emph{not} equivalent to the ``obvious'' expansion, @example -(setf (aref vec (incf i)) (1+ (aref vec (incf i)))) ; Wrong! +(setf (aref vec (cl-incf i)) (1+ (aref vec (cl-incf i)))) ; Wrong! @end example @noindent but rather to something more like @example -(let ((temp (incf i))) +(let ((temp (cl-incf i))) (setf (aref vec temp) (1+ (aref vec temp)))) @end example @noindent -Again, all of this is taken care of automatically by @code{incf} and +Again, all of this is taken care of automatically by @code{cl-incf} and the other generalized-variable macros. -As a more Emacs-specific example of @code{incf}, the expression -@code{(incf (point) @var{n})} is essentially equivalent to +As a more Emacs-specific example of @code{cl-incf}, the expression +@code{(cl-incf (point) @var{n})} is essentially equivalent to @code{(forward-char @var{n})}. @end defspec -@defspec decf place &optional x +@defspec cl-decf place &optional x This macro decrements the number stored in @var{place} by one, or by @var{x} if specified. @end defspec @@ -1256,7 +1256,7 @@ It does the bindings in sequential rather than parallel order. This is the ``generic'' modify macro. It calls @var{function}, which should be an unquoted function name, macro name, or lambda. It passes @var{place} and @var{args} as arguments, and assigns the -result back to @var{place}. For example, @code{(incf @var{place} +result back to @var{place}. For example, @code{(cl-incf @var{place} @var{n})} is the same as @code{(callf + @var{place} @var{n})}. Some more examples: @@ -1279,7 +1279,7 @@ equivalent to @code{(callf2 cons @var{x} @var{place})}. @end defspec The @code{callf} and @code{callf2} macros serve as building -blocks for other macros like @code{incf}, @code{pushnew}, and +blocks for other macros like @code{cl-incf}, @code{pushnew}, and @code{define-modify-macro}. The @code{letf} and @code{letf*} macros are used in the processing of symbol macros; @pxref{Macro Bindings}. @@ -1294,7 +1294,7 @@ user to extend generalized variables in various ways. @defspec define-modify-macro name arglist function [doc-string] This macro defines a ``read-modify-write'' macro similar to -@code{incf} and @code{decf}. The macro @var{name} is defined +@code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined to take a @var{place} argument followed by additional arguments described by @var{arglist}. The call @@ -1306,7 +1306,7 @@ described by @var{arglist}. The call will be expanded to @example -(callf @var{func} @var{place} @var{args}...) +(cl-callf @var{func} @var{place} @var{args}...) @end example @noindent @@ -1319,8 +1319,8 @@ which in turn is roughly equivalent to For example: @example -(define-modify-macro incf (&optional (n 1)) +) -(define-modify-macro concatf (&rest args) concat) +(define-modify-macro cl-incf (&optional (n 1)) +) +(define-modify-macro cl-concatf (&rest args) concat) @end example Note that @code{&key} is not allowed in @var{arglist}, but @@ -1399,7 +1399,7 @@ For example, the simple form of @code{defsetf} is shorthand for The Lisp form that is returned can access the arguments from @var{arglist} and @var{store-var} in an unrestricted fashion; -macros like @code{setf} and @code{incf} which invoke this +macros like @code{setf} and @code{cl-incf} which invoke this setf-method will insert temporary variables as needed to make sure the apparent order of evaluation is preserved. @@ -1452,7 +1452,7 @@ temporary variables. In the setf-methods generated by @code{defsetf}, the second return value is simply the list of arguments in the place form, and the first return value is a list of a corresponding number of temporary variables generated -by @code{gensym}. Macros like @code{setf} and @code{incf} which +by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which use this setf-method will optimize away most temporaries that turn out to be unnecessary, so there is little reason for the setf-method itself to optimize. @@ -1463,11 +1463,12 @@ This function returns the setf-method for @var{place}, by invoking the definition previously recorded by @code{defsetf} or @code{define-setf-method}. The result is a list of five values as described above. You can use this function to build -your own @code{incf}-like modify macros. (Actually, it is +your own @code{cl-incf}-like modify macros. (Actually, it is +@c FIXME? better to use the internal functions @code{cl-setf-do-modify} and @code{cl-setf-do-store}, which are a bit easier to use and which also do a number of optimizations; consult the source -code for the @code{incf} function for a simple example.) +code for the @code{cl-incf} function for a simple example.) The argument @var{env} specifies the ``environment'' to be passed on to @code{macroexpand} if @code{get-setf-method} should @@ -1504,14 +1505,14 @@ defined later. These Lisp forms make bindings to variables and function names, analogous to Lisp's built-in @code{let} form. -@xref{Modify Macros}, for the @code{letf} and @code{letf*} forms which +@xref{Modify Macros}, for the @code{letf} and @code{cl-letf*} forms which are also related to variable bindings. @menu -* Dynamic Bindings:: The @code{progv} form. +* Dynamic Bindings:: The @code{cl-progv} form. * Lexical Bindings:: @code{lexical-let} and lexical closures. * Function Bindings:: @code{flet} and @code{labels}. -* Macro Bindings:: @code{macrolet} and @code{symbol-macrolet}. +* Macro Bindings:: @code{cl-macrolet} and @code{cl-symbol-macrolet}. @end menu @node Dynamic Bindings @@ -1519,10 +1520,10 @@ are also related to variable bindings. @noindent The standard @code{let} form binds variables whose names are known -at compile-time. The @code{progv} form provides an easy way to +at compile-time. The @code{cl-progv} form provides an easy way to bind variables whose names are computed at run-time. -@defspec progv symbols values forms@dots{} +@defspec cl-progv symbols values forms@dots{} This form establishes @code{let}-style variable bindings on a set of variables computed at run-time. The expressions @var{symbols} and @var{values} are evaluated, and must return lists @@ -1587,7 +1588,7 @@ call to @code{make-adder} itself. @example (defun make-counter () (lexical-let ((n 0)) - (function* (lambda (&optional (m 1)) (incf n m))))) + (cl-function (lambda (&optional (m 1)) (cl-incf n m))))) (setq count-1 (make-counter)) (funcall count-1 3) @result{} 3 @@ -1696,8 +1697,8 @@ handling. Attempts to redefine such functions using @code{flet} will fail if byte-compiled. In such cases, use @code{labels} instead. Functions defined by @code{flet} may use the full Common Lisp -argument notation supported by @code{defun*}; also, the function -body is enclosed in an implicit block as if by @code{defun*}. +argument notation supported by @code{cl-defun}; also, the function +body is enclosed in an implicit block as if by @code{cl-defun}. @xref{Program Structure}. @end defspec @@ -1730,21 +1731,21 @@ function, or a use of its name quoted by @code{quote} or @noindent These forms create local macros and ``symbol macros.'' -@defspec macrolet (bindings@dots{}) forms@dots{} +@defspec cl-macrolet (bindings@dots{}) forms@dots{} This form is analogous to @code{flet}, but for macros instead of functions. Each @var{binding} is a list of the same form as the -arguments to @code{defmacro*} (i.e., a macro name, argument list, +arguments to @code{cl-defmacro} (i.e., a macro name, argument list, and macro-expander forms). The macro is defined accordingly for -use within the body of the @code{macrolet}. +use within the body of the @code{cl-macrolet}. -Because of the nature of macros, @code{macrolet} is lexically -scoped even in Emacs Lisp: The @code{macrolet} binding will +Because of the nature of macros, @code{cl-macrolet} is lexically +scoped even in Emacs Lisp: The @code{cl-macrolet} binding will affect only calls that appear physically within the body @var{forms}, possibly after expansion of other macros in the body. @end defspec -@defspec symbol-macrolet (bindings@dots{}) forms@dots{} +@defspec cl-symbol-macrolet (bindings@dots{}) forms@dots{} This form creates @dfn{symbol macros}, which are macros that look like variable references rather than function calls. Each @var{binding} is a list @samp{(@var{var} @var{expansion})}; @@ -1753,8 +1754,8 @@ replaced by @var{expansion}. @example (setq bar '(5 . 9)) -(symbol-macrolet ((foo (car bar))) - (incf foo)) +(cl-symbol-macrolet ((foo (car bar))) + (cl-incf foo)) bar @result{} (6 . 9) @end example @@ -1766,23 +1767,23 @@ I.e., @code{(setq foo 4)} in the above would be equivalent to Likewise, a @code{let} or @code{let*} binding a symbol macro is treated like a @code{letf} or @code{letf*}. This differs from true Common Lisp, where the rules of lexical scoping cause a @code{let} -binding to shadow a @code{symbol-macrolet} binding. In this package, +binding to shadow a @code{cl-symbol-macrolet} binding. In this package, only @code{lexical-let} and @code{lexical-let*} will shadow a symbol macro. There is no analogue of @code{defmacro} for symbol macros; all symbol -macros are local. A typical use of @code{symbol-macrolet} is in the +macros are local. A typical use of @code{cl-symbol-macrolet} is in the expansion of another macro: @example -(defmacro* my-dolist ((x list) &rest body) +(cl-defmacro my-dolist ((x list) &rest body) (let ((var (gensym))) - (list 'loop 'for var 'on list 'do - (list* 'symbol-macrolet (list (list x (list 'car var))) + (list 'cl-loop 'for var 'on list 'do + (cl-list* 'cl-symbol-macrolet (list (list x (list 'car var))) body)))) (setq mylist '(1 2 3 4)) -(my-dolist (x mylist) (incf x)) +(my-dolist (x mylist) (cl-incf x)) mylist @result{} (2 3 4 5) @end example @@ -1794,19 +1795,19 @@ reference onto the elements of the list. The @code{my-dolist} call shown here expands to @example -(loop for G1234 on mylist do - (symbol-macrolet ((x (car G1234))) - (incf x))) +(cl-loop for G1234 on mylist do + (cl-symbol-macrolet ((x (car G1234))) + (cl-incf x))) @end example @noindent which in turn expands to @example -(loop for G1234 on mylist do (incf (car G1234))) +(cl-loop for G1234 on mylist do (cl-incf (car G1234))) @end example -@xref{Loop Facility}, for a description of the @code{loop} macro. +@xref{Loop Facility}, for a description of the @code{cl-loop} macro. This package defines a nonstandard @code{in-ref} loop clause that works much like @code{my-dolist}. @end defspec @@ -1818,11 +1819,11 @@ works much like @code{my-dolist}. These conditional forms augment Emacs Lisp's simple @code{if}, @code{and}, @code{or}, and @code{cond} forms. -@defspec case keyform clause@dots{} +@defspec cl-case keyform clause@dots{} This macro evaluates @var{keyform}, then compares it with the key values listed in the various @var{clause}s. Whichever clause matches the key is executed; comparison is done by @code{eql}. If no clause -matches, the @code{case} form returns @code{nil}. The clauses are +matches, the @code{cl-case} form returns @code{nil}. The clauses are of the form @example @@ -1846,7 +1847,7 @@ four things depending on whether it is an @samp{a}, a @samp{b}, a @key{RET} or @kbd{C-j}, or anything else. @example -(case (read-char) +(cl-case (read-char) (?a (do-a-thing)) (?b (do-b-thing)) ((?\r ?\n) (do-ret-thing)) @@ -1854,20 +1855,20 @@ a @key{RET} or @kbd{C-j}, or anything else. @end example @end defspec -@defspec ecase keyform clause@dots{} -This macro is just like @code{case}, except that if the key does +@defspec cl-ecase keyform clause@dots{} +This macro is just like @code{cl-case}, except that if the key does not match any of the clauses, an error is signaled rather than simply returning @code{nil}. @end defspec -@defspec typecase keyform clause@dots{} -This macro is a version of @code{case} that checks for types +@defspec cl-typecase keyform clause@dots{} +This macro is a version of @code{cl-case} that checks for types rather than values. Each @var{clause} is of the form @samp{(@var{type} @var{body}...)}. @xref{Type Predicates}, for a description of type specifiers. For example, @example -(typecase x +(cl-typecase x (integer (munch-integer x)) (float (munch-float x)) (string (munch-integer (string-to-int x))) @@ -1879,8 +1880,8 @@ The type specifier @code{t} matches any type of object; the word several types, use an @code{(or ...)} type specifier. @end defspec -@defspec etypecase keyform clause@dots{} -This macro is just like @code{typecase}, except that if the key does +@defspec cl-etypecase keyform clause@dots{} +This macro is just like @code{cl-typecase}, except that if the key does not match any of the clauses, an error is signaled rather than simply returning @code{nil}. @end defspec @@ -1891,26 +1892,26 @@ simply returning @code{nil}. @noindent Common Lisp @dfn{blocks} provide a non-local exit mechanism very similar to @code{catch} and @code{throw}, but lexically rather than -dynamically scoped. This package actually implements @code{block} +dynamically scoped. This package actually implements @code{cl-block} in terms of @code{catch}; however, the lexical scoping allows the optimizing byte-compiler to omit the costly @code{catch} step if the -body of the block does not actually @code{return-from} the block. +body of the block does not actually @code{cl-return-from} the block. -@defspec block name forms@dots{} +@defspec cl-block name forms@dots{} The @var{forms} are evaluated as if by a @code{progn}. However, -if any of the @var{forms} execute @code{(return-from @var{name})}, -they will jump out and return directly from the @code{block} form. -The @code{block} returns the result of the last @var{form} unless -a @code{return-from} occurs. +if any of the @var{forms} execute @code{(cl-return-from @var{name})}, +they will jump out and return directly from the @code{cl-block} form. +The @code{cl-block} returns the result of the last @var{form} unless +a @code{cl-return-from} occurs. -The @code{block}/@code{return-from} mechanism is quite similar to +The @code{cl-block}/@code{cl-return-from} mechanism is quite similar to the @code{catch}/@code{throw} mechanism. The main differences are that block @var{name}s are unevaluated symbols, rather than forms (such as quoted symbols) which evaluate to a tag at run-time; and also that blocks are lexically scoped whereas @code{catch}/@code{throw} are dynamically scoped. This means that functions called from the body of a @code{catch} can also @code{throw} to the @code{catch}, -but the @code{return-from} referring to a block name must appear +but the @code{cl-return-from} referring to a block name must appear physically within the @var{forms} that make up the body of the block. They may not appear within other called functions, although they may appear within macro expansions or @code{lambda}s in the body. Block @@ -1919,11 +1920,11 @@ names and @code{catch} names form independent name-spaces. In true Common Lisp, @code{defun} and @code{defmacro} surround the function or expander bodies with implicit blocks with the same name as the function or macro. This does not occur in Emacs -Lisp, but this package provides @code{defun*} and @code{defmacro*} +Lisp, but this package provides @code{cl-defun} and @code{cl-defmacro} forms which do create the implicit block. The Common Lisp looping constructs defined by this package, -such as @code{loop} and @code{dolist}, also create implicit blocks +such as @code{cl-loop} and @code{cl-dolist}, also create implicit blocks just as in Common Lisp. Because they are implemented in terms of Emacs Lisp @code{catch} @@ -1931,22 +1932,22 @@ and @code{throw}, blocks have the same overhead as actual @code{catch} constructs (roughly two function calls). However, the optimizing byte compiler will optimize away the @code{catch} if the block does -not in fact contain any @code{return} or @code{return-from} calls -that jump to it. This means that @code{do} loops and @code{defun*} -functions which don't use @code{return} don't pay the overhead to +not in fact contain any @code{cl-return} or @code{cl-return-from} calls +that jump to it. This means that @code{cl-do} loops and @code{cl-defun} +functions which don't use @code{cl-return} don't pay the overhead to support it. @end defspec -@defspec return-from name [result] +@defspec cl-return-from name [result] This macro returns from the block named @var{name}, which must be an (unevaluated) symbol. If a @var{result} form is specified, it is evaluated to produce the result returned from the @code{block}. Otherwise, @code{nil} is returned. @end defspec -@defspec return [result] -This macro is exactly like @code{(return-from nil @var{result})}. -Common Lisp loops like @code{do} and @code{dolist} implicitly enclose +@defspec cl-return [result] +This macro is exactly like @code{(cl-return-from nil @var{result})}. +Common Lisp loops like @code{cl-do} and @code{cl-dolist} implicitly enclose themselves in @code{nil} blocks. @end defspec @@ -1958,27 +1959,27 @@ The macros described here provide more sophisticated, high-level looping constructs to complement Emacs Lisp's basic @code{while} loop. -@defspec loop forms@dots{} +@defspec cl-loop forms@dots{} The @code{CL} package supports both the simple, old-style meaning of @code{loop} and the extremely powerful and flexible feature known as the @dfn{Loop Facility} or @dfn{Loop Macro}. This more advanced facility is discussed in the following section; @pxref{Loop Facility}. The simple form of @code{loop} is described here. -If @code{loop} is followed by zero or more Lisp expressions, -then @code{(loop @var{exprs}@dots{})} simply creates an infinite +If @code{cl-loop} is followed by zero or more Lisp expressions, +then @code{(cl-loop @var{exprs}@dots{})} simply creates an infinite loop executing the expressions over and over. The loop is enclosed in an implicit @code{nil} block. Thus, @example -(loop (foo) (if (no-more) (return 72)) (bar)) +(cl-loop (foo) (if (no-more) (return 72)) (bar)) @end example @noindent is exactly equivalent to @example -(block nil (while t (foo) (if (no-more) (return 72)) (bar))) +(cl-block nil (while t (foo) (if (no-more) (return 72)) (bar))) @end example If any of the expressions are plain symbols, the loop is instead @@ -1988,7 +1989,7 @@ in the above notation would simply access and throw away the value of a variable.) @end defspec -@defspec do (spec@dots{}) (end-test [result@dots{}]) forms@dots{} +@defspec cl-do (spec@dots{}) (end-test [result@dots{}]) forms@dots{} This macro creates a general iterative loop. Each @var{spec} is of the form @@ -2006,8 +2007,8 @@ begins. Once the @var{end-test} becomes true, the @var{result} forms are evaluated (with the @var{var}s still bound to their values) to produce the result returned by @code{do}. -The entire @code{do} loop is enclosed in an implicit @code{nil} -block, so that you can use @code{(return)} to break out of the +The entire @code{cl-do} loop is enclosed in an implicit @code{nil} +block, so that you can use @code{(cl-return)} to break out of the loop at any time. If there are no @var{result} forms, the loop returns @code{nil}. @@ -2023,21 +2024,21 @@ in place of @samp{(@var{var})}, again following the analogy with This example (from Steele) illustrates a loop which applies the function @code{f} to successive pairs of values from the lists @code{foo} and @code{bar}; it is equivalent to the call -@code{(mapcar* 'f foo bar)}. Note that this loop has no body +@code{(cl-mapcar 'f foo bar)}. Note that this loop has no body @var{forms} at all, performing all its work as side effects of the rest of the loop. @example -(do ((x foo (cdr x)) - (y bar (cdr y)) - (z nil (cons (f (car x) (car y)) z))) - ((or (null x) (null y)) - (nreverse z))) +(cl-do ((x foo (cdr x)) + (y bar (cdr y)) + (z nil (cons (f (car x) (car y)) z))) + ((or (null x) (null y)) + (nreverse z))) @end example @end defspec -@defspec do* (spec@dots{}) (end-test [result@dots{}]) forms@dots{} -This is to @code{do} what @code{let*} is to @code{let}. In +@defspec cl-do* (spec@dots{}) (end-test [result@dots{}]) forms@dots{} +This is to @code{cl-do} what @code{let*} is to @code{let}. In particular, the initial values are bound as if by @code{let*} rather than @code{let}, and the steps are assigned as if by @code{setq} rather than @code{cl-psetq}. @@ -2045,18 +2046,18 @@ rather than @code{let}, and the steps are assigned as if by Here is another way to write the above loop: @example -(do* ((xp foo (cdr xp)) - (yp bar (cdr yp)) - (x (car xp) (car xp)) - (y (car yp) (car yp)) - z) +(cl-do* ((xp foo (cdr xp)) + (yp bar (cdr yp)) + (x (car xp) (car xp)) + (y (car yp) (car yp)) + z) ((or (null xp) (null yp)) (nreverse z)) (push (f x y) z)) @end example @end defspec -@defspec dolist (var list [result]) forms@dots{} +@defspec cl-dolist (var list [result]) forms@dots{} This is a more specialized loop which iterates across the elements of a list. @var{list} should evaluate to a list; the body @var{forms} are executed with @var{var} bound to each element of the list in @@ -2066,7 +2067,7 @@ the loop. Unlike with Emacs's built in @code{dolist}, the loop is surrounded by an implicit @code{nil} block. @end defspec -@defspec dotimes (var count [result]) forms@dots{} +@defspec cl-dotimes (var count [result]) forms@dots{} This is a more specialized loop which iterates a specified number of times. The body is executed with @var{var} bound to the integers from zero (inclusive) to @var{count} (exclusive), in turn. Then @@ -2076,7 +2077,7 @@ to get the return value for the loop form. Unlike with Emacs's built in @code{dolist}, the loop is surrounded by an implicit @code{nil} block. @end defspec -@defspec do-symbols (var [obarray [result]]) forms@dots{} +@defspec cl-do-symbols (var [obarray [result]]) forms@dots{} This loop iterates over all interned symbols. If @var{obarray} is specified and is not @code{nil}, it loops over all symbols in that obarray. For each symbol, the body @var{forms} are evaluated @@ -2086,8 +2087,8 @@ is evaluated (with @var{var} bound to @code{nil}) to get the return value. The loop is surrounded by an implicit @code{nil} block. @end defspec -@defspec do-all-symbols (var [result]) forms@dots{} -This is identical to @code{do-symbols} except that the @var{obarray} +@defspec cl-do-all-symbols (var [result]) forms@dots{} +This is identical to @code{cl-do-symbols} except that the @var{obarray} argument is omitted; it always iterates over the default obarray. @end defspec @@ -2108,8 +2109,8 @@ construct called the ``Loop Facility'' or ``@code{loop} macro,'' with an easy-to-use but very powerful and expressive syntax. @menu -* Loop Basics:: @code{loop} macro, basic clause structure. -* Loop Examples:: Working examples of @code{loop} macro. +* Loop Basics:: @code{cl-loop} macro, basic clause structure. +* Loop Examples:: Working examples of @code{cl-loop} macro. * For Clauses:: Clauses introduced by @code{for} or @code{as}. * Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc. * Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc. @@ -2120,19 +2121,19 @@ with an easy-to-use but very powerful and expressive syntax. @subsection Loop Basics @noindent -The @code{loop} macro essentially creates a mini-language within +The @code{cl-loop} macro essentially creates a mini-language within Lisp that is specially tailored for describing loops. While this language is a little strange-looking by the standards of regular Lisp, it turns out to be very easy to learn and well-suited to its purpose. -Since @code{loop} is a macro, all parsing of the loop language -takes place at byte-compile time; compiled @code{loop}s are just +Since @code{cl-loop} is a macro, all parsing of the loop language +takes place at byte-compile time; compiled @code{cl-loop}s are just as efficient as the equivalent @code{while} loops written longhand. -@defspec loop clauses@dots{} +@defspec cl-loop clauses@dots{} A loop construct consists of a series of @var{clause}s, each introduced by a symbol like @code{for} or @code{do}. Clauses -are simply strung together in the argument list of @code{loop}, +are simply strung together in the argument list of @code{cl-loop}, with minimal extra parentheses. The various types of clauses specify initializations, such as the binding of temporary variables, actions to be taken in the loop, stepping actions, @@ -2142,9 +2143,9 @@ Common Lisp specifies a certain general order of clauses in a loop: @example -(loop @var{name-clause} - @var{var-clauses}@dots{} - @var{action-clauses}@dots{}) +(cl-loop @var{name-clause} + @var{var-clauses}@dots{} + @var{action-clauses}@dots{}) @end example The @var{name-clause} optionally gives a name to the implicit @@ -2155,7 +2156,7 @@ be modified or iterated throughout the course of the loop. The @var{action-clauses} are things to be done during the loop, such as computing, collecting, and returning values. -The Emacs version of the @code{loop} macro is less restrictive about +The Emacs version of the @code{cl-loop} macro is less restrictive about the order of clauses, but things will behave most predictably if you put the variable-binding clauses @code{with}, @code{for}, and @code{repeat} before the action clauses. As in Common Lisp, @@ -2180,25 +2181,25 @@ for additional discussion and examples of the @code{loop} macro. @noindent Before listing the full set of clauses that are allowed, let's -look at a few example loops just to get a feel for the @code{loop} +look at a few example loops just to get a feel for the @code{cl-loop} language. @example -(loop for buf in (buffer-list) - collect (buffer-file-name buf)) +(cl-loop for buf in (buffer-list) + collect (buffer-file-name buf)) @end example @noindent This loop iterates over all Emacs buffers, using the list returned by @code{buffer-list}. For each buffer @code{buf}, it calls @code{buffer-file-name} and collects the results into -a list, which is then returned from the @code{loop} construct. +a list, which is then returned from the @code{cl-loop} construct. The result is a list of the file names of all the buffers in Emacs's memory. The words @code{for}, @code{in}, and @code{collect} -are reserved words in the @code{loop} language. +are reserved words in the @code{cl-loop} language. @example -(loop repeat 20 do (insert "Yowsa\n")) +(cl-loop repeat 20 do (insert "Yowsa\n")) @end example @noindent @@ -2206,7 +2207,7 @@ This loop inserts the phrase ``Yowsa'' twenty times in the current buffer. @example -(loop until (eobp) do (munch-line) (forward-line 1)) +(cl-loop until (eobp) do (munch-line) (forward-line 1)) @end example @noindent @@ -2215,7 +2216,7 @@ of the buffer. If point is already at the end of the buffer, the loop exits immediately. @example -(loop do (munch-line) until (eobp) do (forward-line 1)) +(cl-loop do (munch-line) until (eobp) do (forward-line 1)) @end example @noindent @@ -2223,10 +2224,10 @@ This loop is similar to the above one, except that @code{munch-line} is always called at least once. @example -(loop for x from 1 to 100 - for y = (* x x) - until (>= y 729) - finally return (list x (= y 729))) +(cl-loop for x from 1 to 100 + for y = (* x x) + until (>= y 729) + finally return (list x (= y 729))) @end example @noindent @@ -2246,7 +2247,7 @@ Note that even though this loop contains three clauses (two @code{for}s and an @code{until}) that would have been enough to define loops all by themselves, it still creates a single loop rather than some sort of triple-nested loop. You must explicitly -nest your @code{loop} constructs if you want nested loops. +nest your @code{cl-loop} constructs if you want nested loops. @node For Clauses @subsection For Clauses @@ -2272,7 +2273,7 @@ The variable is bound around the loop as if by @code{let}: @example (setq i 'happy) -(loop for i from 1 to 10 do (do-something-with i)) +(cl-loop for i from 1 to 10 do (do-something-with i)) i @result{} happy @end example @@ -2302,10 +2303,10 @@ which are like @code{upto} and @code{downto} respectively except that they are exclusive rather than inclusive limits: @example -(loop for x to 10 collect x) - @result{} (0 1 2 3 4 5 6 7 8 9 10) -(loop for x below 10 collect x) - @result{} (0 1 2 3 4 5 6 7 8 9) +(cl-loop for x to 10 collect x) + @result{} (0 1 2 3 4 5 6 7 8 9 10) +(cl-loop for x below 10 collect x) + @result{} (0 1 2 3 4 5 6 7 8 9) @end example The @code{by} value is always positive, even for downward-counting @@ -2320,25 +2321,25 @@ is used to traverse the list instead of @code{cdr}; it must be a function taking one argument. For example: @example -(loop for x in '(1 2 3 4 5 6) collect (* x x)) - @result{} (1 4 9 16 25 36) -(loop for x in '(1 2 3 4 5 6) by 'cddr collect (* x x)) - @result{} (1 9 25) +(cl-loop for x in '(1 2 3 4 5 6) collect (* x x)) + @result{} (1 4 9 16 25 36) +(cl-loop for x in '(1 2 3 4 5 6) by 'cddr collect (* x x)) + @result{} (1 9 25) @end example @item for @var{var} on @var{list} by @var{function} This clause iterates @var{var} over all the cons cells of @var{list}. @example -(loop for x on '(1 2 3 4) collect x) - @result{} ((1 2 3 4) (2 3 4) (3 4) (4)) +(cl-loop for x on '(1 2 3 4) collect x) + @result{} ((1 2 3 4) (2 3 4) (3 4) (4)) @end example With @code{by}, there is no real reason that the @code{on} expression must be a list. For example: @example -(loop for x on first-animal by 'next-animal collect x) +(cl-loop for x on first-animal by 'next-animal collect x) @end example @noindent @@ -2352,7 +2353,7 @@ a @code{setf}-able ``reference'' onto the elements of the list rather than just a temporary variable. For example, @example -(loop for x in-ref my-list do (incf x)) +(cl-loop for x in-ref my-list do (cl-incf x)) @end example @noindent @@ -2364,8 +2365,8 @@ This clause iterates @var{var} over all the elements of @var{array}, which may be a vector or a string. @example -(loop for x across "aeiou" - do (use-vowel (char-to-string x))) +(cl-loop for x across "aeiou" + do (use-vowel (char-to-string x))) @end example @item for @var{var} across-ref @var{array} @@ -2397,10 +2398,10 @@ an unspecified order. As an example, @example -(loop for sym being the symbols - when (fboundp sym) - when (string-match "^map" (symbol-name sym)) - collect sym) +(cl-loop for sym being the symbols + when (fboundp sym) + when (string-match "^map" (symbol-name sym)) + collect sym) @end example @noindent @@ -2411,7 +2412,7 @@ are also recognized but are equivalent to @code{symbols} in Emacs Lisp. Due to a minor implementation restriction, it will not work to have more than one @code{for} clause iterating over symbols, hash tables, -keymaps, overlays, or intervals in a given @code{loop}. Fortunately, +keymaps, overlays, or intervals in a given @code{cl-loop}. Fortunately, it would rarely if ever be useful to do so. It @emph{is} valid to mix one of these types of clauses with other clauses like @code{for ... to} or @code{while}. @@ -2423,10 +2424,10 @@ This clause iterates over the entries in @var{hash-table} with a second variable to the opposite part. @example -(loop for k being the hash-keys of h - using (hash-values v) - do - (message "key %S -> value %S" k v)) +(cl-loop for k being the hash-keys of h + using (hash-values v) + do + (message "key %S -> value %S" k v)) @end example @item for @var{var} being the key-codes of @var{keymap} @@ -2438,10 +2439,10 @@ A @code{using} clause can access both the codes and the bindings together. @example -(loop for c being the key-codes of (current-local-map) - using (key-bindings b) - do - (message "key %S -> binding %S" c b)) +(cl-loop for c being the key-codes of (current-local-map) + using (key-bindings b) + do + (message "key %S -> binding %S" c b)) @end example @@ -2497,8 +2498,8 @@ and successive iterations it will be set by evaluating @var{expr2} these two loops are effectively the same: @example -(loop for x on my-list by 'cddr do ...) -(loop for x = my-list then (cddr x) while x do ...) +(cl-loop for x on my-list by 'cddr do ...) +(cl-loop for x = my-list then (cddr x) while x do ...) @end example Note that this type of @code{for} clause does not imply any sort @@ -2509,7 +2510,7 @@ If you omit the @code{then} term, @var{expr1} is used both for the initial setting and for successive settings: @example -(loop for x = (random) when (> x 0) return x) +(cl-loop for x = (random) when (> x 0) return x) @end example @noindent @@ -2524,10 +2525,10 @@ in which case they are processed in parallel (as if by @code{let} and @code{cl-psetq}). @example -(loop for x below 5 for y = nil then x collect (list x y)) - @result{} ((0 nil) (1 1) (2 2) (3 3) (4 4)) -(loop for x below 5 and y = nil then x collect (list x y)) - @result{} ((0 nil) (1 0) (2 1) (3 2) (4 3)) +(cl-loop for x below 5 for y = nil then x collect (list x y)) + @result{} ((0 nil) (1 1) (2 2) (3 3) (4 4)) +(cl-loop for x below 5 and y = nil then x collect (list x y)) + @result{} ((0 nil) (1 0) (2 1) (3 2) (4 3)) @end example @noindent @@ -2537,7 +2538,7 @@ that was just set by the previous clause; in the second loop, based on the value of @code{x} left over from the previous time through the loop. -Another feature of the @code{loop} macro is @dfn{destructuring}, +Another feature of the @code{cl-loop} macro is @dfn{destructuring}, similar in concept to the destructuring provided by @code{defmacro}. The @var{var} part of any @code{for} clause can be given as a list of variables instead of a single variable. The values produced @@ -2545,8 +2546,8 @@ during loop execution must be lists; the values in the lists are stored in the corresponding variables. @example -(loop for (x y) in '((2 3) (4 5) (6 7)) collect (+ x y)) - @result{} (5 9 13) +(cl-loop for (x y) in '((2 3) (4 5) (6 7)) collect (+ x y)) + @result{} (5 9 13) @end example In loop destructuring, if there are more values than variables @@ -2558,9 +2559,9 @@ lists of variables like @code{(x . y)} are allowed, so for example to process an alist @example -(loop for (key . value) in '((a . 1) (b . 2)) - collect value) - @result{} (1 2) +(cl-loop for (key . value) in '((a . 1) (b . 2)) + collect value) + @result{} (1 2) @end example @node Iteration Clauses @@ -2577,8 +2578,8 @@ This clause simply counts up to the specified number using an internal temporary variable. The loops @example -(loop repeat (1+ n) do ...) -(loop for temp to n do ...) +(cl-loop repeat (1+ n) do ...) +(cl-loop for temp to n do ...) @end example @noindent @@ -2593,7 +2594,7 @@ that surrounds the second one: @example (while @var{cond} @var{forms}@dots{}) -(loop while @var{cond} do @var{forms}@dots{}) +(cl-loop while @var{cond} do @var{forms}@dots{}) @end example @item until @var{condition} @@ -2607,7 +2608,7 @@ the @code{finally} clauses are not executed. If all the conditions were non-@code{nil}, the loop returns @code{t}: @example -(if (loop for size in size-list always (> size 10)) +(if (cl-loop for size in size-list always (> size 10)) (some-big-sizes) (no-big-sizes)) @end example @@ -2684,11 +2685,11 @@ It is valid for several accumulation clauses of the same type to accumulate into the same place. From Steele: @example -(loop for name in '(fred sue alice joe june) - for kids in '((bob ken) () () (kris sunshine) ()) - collect name - append kids) - @result{} (fred bob ken sue alice joe kris sunshine june) +(cl-loop for name in '(fred sue alice joe june) + for kids in '((bob ken) () () (kris sunshine) ()) + collect name + append kids) + @result{} (fred bob ken sue alice joe kris sunshine june) @end example @node Other Clauses @@ -2704,17 +2705,17 @@ otherwise leaves the variable alone during the loop. The following loops are basically equivalent: @example -(loop with x = 17 do ...) -(let ((x 17)) (loop do ...)) -(loop for x = 17 then x do ...) +(cl-loop with x = 17 do ...) +(let ((x 17)) (cl-loop do ...)) +(cl-loop for x = 17 then x do ...) @end example Naturally, the variable @var{var} might be used for some purpose in the rest of the loop. For example: @example -(loop for x in my-list with res = nil do (push x res) - finally return res) +(cl-loop for x in my-list with res = nil do (push x res) + finally return res) @end example This loop inserts the elements of @code{my-list} at the front of @@ -2749,18 +2750,18 @@ by the name @code{it} in the ``then'' part. For example: @example (setq funny-numbers '(6 13 -1)) @result{} (6 13 -1) -(loop for x below 10 - if (oddp x) - collect x into odds - and if (memq x funny-numbers) return (cdr it) end - else - collect x into evens - finally return (vector odds evens)) - @result{} [(1 3 5 7 9) (0 2 4 6 8)] +(cl-loop for x below 10 + if (oddp x) + collect x into odds + and if (memq x funny-numbers) return (cdr it) end + else + collect x into evens + finally return (vector odds evens)) + @result{} [(1 3 5 7 9) (0 2 4 6 8)] (setq funny-numbers '(6 7 13 -1)) @result{} (6 7 13 -1) -(loop <@r{same thing again}>) - @result{} (13 -1) +(cl-loop <@r{same thing again}>) + @result{} (13 -1) @end example Note the use of @code{and} to put two clauses into the ``then'' @@ -2828,7 +2829,7 @@ was named). The @code{return} clause is implemented a bit more efficiently, though. @end table -While there is no high-level way to add user extensions to @code{loop} +While there is no high-level way to add user extensions to @code{cl-loop} (comparable to @code{defsetf} for @code{setf}, say), this package does offer two properties called @code{cl-loop-handler} and @code{cl-loop-for-handler} which are functions to be called when @@ -2836,7 +2837,7 @@ a given symbol is encountered as a top-level loop clause or @code{for} clause, respectively. Consult the source code in file @file{cl-macs.el} for details. -This package's @code{loop} macro is compatible with that of Common +This package's @code{cl-loop} macro is compatible with that of Common Lisp, except that a few features are not implemented: @code{loop-finish} and data-type specifiers. Naturally, the @code{for} clauses which iterate over keymaps, overlays, intervals, frames, windows, and @@ -2851,14 +2852,14 @@ functions, by contrast, always return exactly one result. This package makes no attempt to emulate Common Lisp multiple return values; Emacs versions of Common Lisp functions that return more than one value either return just the first value (as in -@code{compiler-macroexpand}) or return a list of values (as in +@code{cl-compiler-macroexpand}) or return a list of values (as in @code{get-setf-method}). This package @emph{does} define placeholders for the Common Lisp functions that work with multiple values, but in Emacs Lisp these functions simply operate on lists instead. The @code{values} form, for example, is a synonym for @code{list} in Emacs. -@defspec multiple-value-bind (var@dots{}) values-form forms@dots{} +@defspec cl-multiple-value-bind (var@dots{}) values-form forms@dots{} This form evaluates @var{values-form}, which must return a list of values. It then binds the @var{var}s to these respective values, as if by @code{let}, and then executes the body @var{forms}. @@ -2867,18 +2868,18 @@ are bound to @code{nil}. If there are fewer @var{var}s than values, the excess values are ignored. @end defspec -@defspec multiple-value-setq (var@dots{}) form +@defspec cl-multiple-value-setq (var@dots{}) form This form evaluates @var{form}, which must return a list of values. It then sets the @var{var}s to these respective values, as if by @code{setq}. Extra @var{var}s or values are treated the same as -in @code{multiple-value-bind}. +in @code{cl-multiple-value-bind}. @end defspec The older Quiroz package attempted a more faithful (but still imperfect) emulation of Common Lisp multiple values. The old method ``usually'' simulated true multiple values quite well, but under certain circumstances would leave spurious return -values in memory where a later, unrelated @code{multiple-value-bind} +values in memory where a later, unrelated @code{cl-multiple-value-bind} form would see them. Since a perfect emulation is not feasible in Emacs Lisp, this @@ -2897,7 +2898,7 @@ for @code{defmacro} due to technical difficulties. Destructuring is made available to the user by way of the following macro: -@defspec destructuring-bind arglist expr forms@dots{} +@defspec cl-destructuring-bind arglist expr forms@dots{} This macro expands to code which executes @var{forms}, with the variables in @var{arglist} bound to the list of values returned by @var{expr}. The @var{arglist} can include all @@ -2908,11 +2909,11 @@ if @var{expr} returns a list of the wrong number of arguments or with incorrect keyword arguments. @end defspec -This package also includes the Common Lisp @code{define-compiler-macro} +This package also includes the Common Lisp @code{cl-define-compiler-macro} facility, which allows you to define compile-time expansions and optimizations for your functions. -@defspec define-compiler-macro name arglist forms@dots{} +@defspec cl-define-compiler-macro name arglist forms@dots{} This form is similar to @code{defmacro}, except that it only expands calls to @var{name} at compile-time; calls processed by the Lisp interpreter are not expanded, nor are they expanded by the @@ -2930,25 +2931,25 @@ For example, here is a simplified version of a definition that appears as a standard part of this package: @example -(define-compiler-macro member* (&whole form a list &rest keys) - (if (and (null keys) - (eq (car-safe a) 'quote) - (not (floatp-safe (cadr a)))) - (list 'memq a list) - form)) +(cl-define-compiler-macro cl-member (&whole form a list &rest keys) + (if (and (null keys) + (eq (car-safe a) 'quote) + (not (floatp-safe (cadr a)))) + (list 'memq a list) + form)) @end example @noindent -This definition causes @code{(member* @var{a} @var{list})} to change +This definition causes @code{(cl-member @var{a} @var{list})} to change to a call to the faster @code{memq} in the common case where @var{a} is a non-floating-point constant; if @var{a} is anything else, or if there are any keyword arguments in the call, then the original -@code{member*} call is left intact. (The actual compiler macro -for @code{member*} optimizes a number of other cases, including +@code{cl-member} call is left intact. (The actual compiler macro +for @code{cl-member} optimizes a number of other cases, including common @code{:test} predicates.) @end defspec -@defun compiler-macroexpand form +@defun cl-compiler-macroexpand form This function is analogous to @code{macroexpand}, except that it expands compiler macros rather than regular macros. It returns @var{form} unchanged if it is not a call to a function for which @@ -2958,8 +2959,8 @@ decided to punt by returning its @code{&whole} argument. Like for which no further expansion is possible. @end defun -@xref{Macro Bindings}, for descriptions of the @code{macrolet} -and @code{symbol-macrolet} forms for making ``local'' macro +@xref{Macro Bindings}, for descriptions of the @code{cl-macrolet} +and @code{cl-symbol-macrolet} forms for making ``local'' macro definitions. @node Declarations @@ -2971,8 +2972,8 @@ mechanism that allows you to give the compiler special hints about the types of data that will be stored in particular variables, and about the ways those variables and functions will be used. This package defines versions of all the Common Lisp declaration forms: -@code{declare}, @code{locally}, @code{proclaim}, @code{declaim}, -and @code{the}. +@code{cl-declare}, @code{cl-locally}, @code{cl-proclaim}, @code{cl-declaim}, +and @code{cl-the}. Most of the Common Lisp declarations are not currently useful in Emacs Lisp, as the byte-code system provides little opportunity @@ -2982,53 +2983,53 @@ declarations are meaningful when the optimizing byte compiler is being used, however. Under the earlier non-optimizing compiler, these declarations will effectively be ignored. -@defun proclaim decl-spec +@defun cl-proclaim decl-spec This function records a ``global'' declaration specified by -@var{decl-spec}. Since @code{proclaim} is a function, @var{decl-spec} +@var{decl-spec}. Since @code{cl-proclaim} is a function, @var{decl-spec} is evaluated and thus should normally be quoted. @end defun -@defspec declaim decl-specs@dots{} -This macro is like @code{proclaim}, except that it takes any number +@defspec cl-declaim decl-specs@dots{} +This macro is like @code{cl-proclaim}, except that it takes any number of @var{decl-spec} arguments, and the arguments are unevaluated and -unquoted. The @code{declaim} macro also puts an @code{(eval-when +unquoted. The @code{cl-declaim} macro also puts an @code{(cl-eval-when (compile load eval) ...)} around the declarations so that they will be registered at compile-time as well as at run-time. (This is vital, since normally the declarations are meant to influence the way the -compiler treats the rest of the file that contains the @code{declaim} +compiler treats the rest of the file that contains the @code{cl-declaim} form.) @end defspec -@defspec declare decl-specs@dots{} +@defspec cl-declare decl-specs@dots{} This macro is used to make declarations within functions and other code. Common Lisp allows declarations in various locations, generally at the beginning of any of the many ``implicit @code{progn}s'' throughout Lisp syntax, such as function bodies, @code{let} bodies, -etc. Currently the only declaration understood by @code{declare} +etc. Currently the only declaration understood by @code{cl-declare} is @code{special}. @end defspec -@defspec locally declarations@dots{} forms@dots{} -In this package, @code{locally} is no different from @code{progn}. +@defspec cl-locally declarations@dots{} forms@dots{} +In this package, @code{cl-locally} is no different from @code{progn}. @end defspec -@defspec the type form -Type information provided by @code{the} is ignored in this package; -in other words, @code{(the @var{type} @var{form})} is equivalent +@defspec cl-the type form +Type information provided by @code{cl-the} is ignored in this package; +in other words, @code{(cl-the @var{type} @var{form})} is equivalent to @var{form}. Future versions of the optimizing byte-compiler may make use of this information. For example, @code{mapcar} can map over both lists and arrays. It is hard for the compiler to expand @code{mapcar} into an in-line loop unless it knows whether the sequence will be a list or an array ahead -of time. With @code{(mapcar 'car (the vector foo))}, a future +of time. With @code{(mapcar 'car (cl-the vector foo))}, a future compiler would have enough information to expand the loop in-line. For now, Emacs Lisp will treat the above code as exactly equivalent to @code{(mapcar 'car foo)}. @end defspec -Each @var{decl-spec} in a @code{proclaim}, @code{declaim}, or -@code{declare} should be a list beginning with a symbol that says +Each @var{decl-spec} in a @code{cl-proclaim}, @code{cl-declaim}, or +@code{cl-declare} should be a list beginning with a symbol that says what kind of declaration it is. This package currently understands @code{special}, @code{inline}, @code{notinline}, @code{optimize}, and @code{warn} declarations. (The @code{warn} declaration is an @@ -3045,16 +3046,16 @@ bound in the body of the function. The compiler normally emits warnings for such references, since they could be typographical errors for references to local variables. -The declaration @code{(declare (special @var{var1} @var{var2}))} is +The declaration @code{(cl-declare (special @var{var1} @var{var2}))} is equivalent to @code{(defvar @var{var1}) (defvar @var{var2})} in the optimizing compiler, or to nothing at all in older compilers (which do not warn for non-local references). In top-level contexts, it is generally better to write -@code{(defvar @var{var})} than @code{(declaim (special @var{var}))}, +@code{(defvar @var{var})} than @code{(cl-declaim (special @var{var}))}, since @code{defvar} makes your intentions clearer. But the older byte compilers can not handle @code{defvar}s appearing inside of -functions, while @code{(declare (special @var{var}))} takes care +functions, while @code{(cl-declare (special @var{var}))} takes care to work correctly with all compilers. @item inline @@ -3072,8 +3073,8 @@ The following declarations are all equivalent. Note that the and declare it inline all at once. @example -(declaim (inline foo bar)) -(eval-when (compile load eval) (proclaim '(inline foo bar))) +(cl-declaim (inline foo bar)) +(cl-eval-when (compile load eval) (cl-proclaim '(inline foo bar))) (defsubst foo (...) ...) ; instead of defun @end example @@ -3083,10 +3084,10 @@ request that a function you have defined should be inlined, but it is impolite to use it to request inlining of an external function. -In Common Lisp, it is possible to use @code{(declare (inline @dots{}))} +In Common Lisp, it is possible to use @code{(cl-declare (inline @dots{}))} before a particular call to a function to cause just that call to be inlined; the current byte compilers provide no way to implement -this, so @code{(declare (inline @dots{}))} is currently ignored by +this, so @code{(cl-declare (inline @dots{}))} is currently ignored by this package. @item notinline @@ -3107,6 +3108,7 @@ and @code{safety}. The value of a quality should be an integer from The default level for both qualities is 1. In this package, with the optimizing compiler, the +@c FIXME does not exist? @code{speed} quality is tied to the @code{byte-compile-optimize} flag, which is set to @code{nil} for @code{(speed 0)} and to @code{t} for higher settings; and the @code{safety} quality is @@ -3125,10 +3127,10 @@ Emacs itself, Emacs will not crash with a segmentation fault just because of an error in a fully-optimized Lisp program. The @code{optimize} declaration is normally used in a top-level -@code{proclaim} or @code{declaim} in a file; Common Lisp allows -it to be used with @code{declare} to set the level of optimization +@code{cl-proclaim} or @code{cl-declaim} in a file; Common Lisp allows +it to be used with @code{cl-declare} to set the level of optimization locally for a given form, but this will not work correctly with the -current version of the optimizing compiler. (The @code{declare} +current version of the optimizing compiler. (The @code{cl-declare} will set the new optimization level, but that level will not automatically be unset after the enclosing form is done.) @@ -3152,8 +3154,8 @@ This package defines several symbol-related features that were missing from Emacs Lisp. @menu -* Property Lists:: @code{get*}, @code{remprop}, @code{getf}, @code{remf}. -* Creating Symbols:: @code{gensym}, @code{gentemp}. +* Property Lists:: @code{cl-get}, @code{cl-remprop}, @code{cl-getf}, @code{cl-remf}. +* Creating Symbols:: @code{cl-gensym}, @code{cl-gentemp}. @end menu @node Property Lists @@ -3165,18 +3167,18 @@ and @code{put} for operating on properties attached to symbols. There are also functions for working with property lists as first-class data structures not attached to particular symbols. -@defun get* symbol property &optional default +@defun cl-get symbol property &optional default This function is like @code{get}, except that if the property is not found, the @var{default} argument provides the return value. (The Emacs Lisp @code{get} function always uses @code{nil} as -the default; this package's @code{get*} is equivalent to Common +the default; this package's @code{cl-get} is equivalent to Common Lisp's @code{get}.) -The @code{get*} function is @code{setf}-able; when used in this +The @code{cl-get} function is @code{setf}-able; when used in this fashion, the @var{default} argument is allowed but ignored. @end defun -@defun remprop symbol property +@defun cl-remprop symbol property This function removes the entry for @var{property} from the property list of @var{symbol}. It returns a true value if the property was indeed found and removed, or @code{nil} if there was no such property. @@ -3184,10 +3186,10 @@ indeed found and removed, or @code{nil} if there was no such property. since @code{get} did not allow a @var{default}, it was very difficult to distinguish between a missing property and a property whose value was @code{nil}; thus, setting a property to @code{nil} was close -enough to @code{remprop} for most purposes.) +enough to @code{cl-remprop} for most purposes.) @end defun -@defun getf place property &optional default +@defun cl-getf place property &optional default This function scans the list @var{place} as if it were a property list, i.e., a list of alternating property names and values. If an even-numbered element of @var{place} is found which is @code{eq} @@ -3198,7 +3200,7 @@ is given). In particular, @example -(get sym prop) @equiv{} (getf (symbol-plist sym) prop) +(get sym prop) @equiv{} (cl-get (symbol-plist sym) prop) @end example It is valid to use @code{getf} as a @code{setf} place, in which case @@ -3209,25 +3211,26 @@ list that corresponds to @var{property}, or to cons a new property-value pair onto the list if the property is not yet present. @example -(put sym prop val) @equiv{} (setf (getf (symbol-plist sym) prop) val) +(put sym prop val) @equiv{} (setf (cl-get (symbol-plist sym) prop) val) @end example -The @code{get} and @code{get*} functions are also @code{setf}-able. +The @code{get} and @code{cl-get} functions are also @code{setf}-able. The fact that @code{default} is ignored can sometimes be useful: @example -(incf (get* 'foo 'usage-count 0)) +(cl-incf (cl-get 'foo 'usage-count 0)) @end example Here, symbol @code{foo}'s @code{usage-count} property is incremented if it exists, or set to 1 (an incremented 0) otherwise. +@c FIXME cl-getf? When not used as a @code{setf} form, @code{getf} is just a regular function and its @var{place} argument can actually be any Lisp expression. @end defun -@defspec remf place property +@defspec cl-remf place property This macro removes the property-value pair for @var{property} from the property list stored at @var{place}, which is any @code{setf}-able place expression. It returns true if the property was found. Note @@ -3248,7 +3251,7 @@ out the property and value cells. These functions create unique symbols, typically for use as temporary variables. -@defun gensym &optional x +@defun cl-gensym &optional x This function creates a new, uninterned symbol (using @code{make-symbol}) with a unique name. (The name of an uninterned symbol is relevant only if the symbol is printed.) By default, the name is generated @@ -3260,20 +3263,20 @@ their names will not conflict with ``real'' variables in the user's code. @end defun -@defvar *gensym-counter* -This variable holds the counter used to generate @code{gensym} names. -It is incremented after each use by @code{gensym}. In Common Lisp +@defvar cl--gensym-counter +This variable holds the counter used to generate @code{cl-gensym} names. +It is incremented after each use by @code{cl-gensym}. In Common Lisp this is initialized with 0, but this package initializes it with a random (time-dependent) value to avoid trouble when two files that -each used @code{gensym} in their compilation are loaded together. +each used @code{cl-gensym} in their compilation are loaded together. (Uninterned symbols become interned when the compiler writes them out to a file and the Emacs loader loads them, so their names have to be treated a bit more carefully than in Common Lisp where uninterned symbols remain uninterned after loading.) @end defvar -@defun gentemp &optional x -This function is like @code{gensym}, except that it produces a new +@defun cl-gentemp &optional x +This function is like @code{cl-gensym}, except that it produces a new @emph{interned} symbol. If the symbol that is generated already exists, the function keeps incrementing the counter and trying again until a new symbol is generated. @@ -3294,10 +3297,10 @@ This section defines a few simple Common Lisp operations on numbers which were left out of Emacs Lisp. @menu -* Predicates on Numbers:: @code{plusp}, @code{oddp}, @code{floatp-safe}, etc. -* Numerical Functions:: @code{abs}, @code{floor*}, etc. -* Random Numbers:: @code{random*}, @code{make-random-state}. -* Implementation Parameters:: @code{most-positive-float}. +* Predicates on Numbers:: @code{cl-plusp}, @code{cl-oddp}, @code{cl-floatp-safe}, etc. +* Numerical Functions:: @code{abs}, @code{cl-floor}, etc. +* Random Numbers:: @code{cl-random}, @code{cl-make-random-state}. +* Implementation Parameters:: @code{cl-most-positive-float}. @end menu @iftex @@ -3311,27 +3314,27 @@ which were left out of Emacs Lisp. These functions return @code{t} if the specified condition is true of the numerical argument, or @code{nil} otherwise. -@defun plusp number +@defun cl-plusp number This predicate tests whether @var{number} is positive. It is an error if the argument is not a number. @end defun -@defun minusp number +@defun cl-minusp number This predicate tests whether @var{number} is negative. It is an error if the argument is not a number. @end defun -@defun oddp integer +@defun cl-oddp integer This predicate tests whether @var{integer} is odd. It is an error if the argument is not an integer. @end defun -@defun evenp integer +@defun cl-evenp integer This predicate tests whether @var{integer} is even. It is an error if the argument is not an integer. @end defun -@defun floatp-safe object +@defun cl-floatp-safe object This predicate tests whether @var{object} is a floating-point number. On systems that support floating-point, this is equivalent to @code{floatp}. On other systems, this always returns @code{nil}. @@ -3347,30 +3350,26 @@ to @code{floatp}. On other systems, this always returns @code{nil}. @noindent These functions perform various arithmetic operations on numbers. -@defun gcd &rest integers +@defun cl-gcd &rest integers This function returns the Greatest Common Divisor of the arguments. For one argument, it returns the absolute value of that argument. For zero arguments, it returns zero. @end defun -@defun lcm &rest integers +@defun cl-lcm &rest integers This function returns the Least Common Multiple of the arguments. For one argument, it returns the absolute value of that argument. For zero arguments, it returns one. @end defun -@defun isqrt integer +@defun cl-isqrt integer This function computes the ``integer square root'' of its integer argument, i.e., the greatest integer less than or equal to the true square root of the argument. @end defun -@defun floor* number &optional divisor -This function implements the Common Lisp @code{floor} function. -It is called @code{floor*} to avoid name conflicts with the -simpler @code{floor} function built-in to Emacs. - -With one argument, @code{floor*} returns a list of two numbers: +@defun cl-floor number &optional divisor +With one argument, @code{cl-floor} returns a list of two numbers: The argument rounded down (toward minus infinity) to an integer, and the ``remainder'' which would have to be added back to the first return value to yield the argument again. If the argument @@ -3379,37 +3378,37 @@ If the argument is a floating-point number, the first result is a Lisp integer and the second is a Lisp float between 0 (inclusive) and 1 (exclusive). -With two arguments, @code{floor*} divides @var{number} by +With two arguments, @code{cl-floor} divides @var{number} by @var{divisor}, and returns the floor of the quotient and the corresponding remainder as a list of two numbers. If -@code{(floor* @var{x} @var{y})} returns @code{(@var{q} @var{r})}, +@code{(cl-floor @var{x} @var{y})} returns @code{(@var{q} @var{r})}, then @code{@var{q}*@var{y} + @var{r} = @var{x}}, with @var{r} between 0 (inclusive) and @var{r} (exclusive). Also, note -that @code{(floor* @var{x})} is exactly equivalent to -@code{(floor* @var{x} 1)}. +that @code{(cl-floor @var{x})} is exactly equivalent to +@code{(cl-floor @var{x} 1)}. This function is entirely compatible with Common Lisp's @code{floor} function, except that it returns the two results in a list since Emacs Lisp does not support multiple-valued functions. @end defun -@defun ceiling* number &optional divisor +@defun cl-ceiling number &optional divisor This function implements the Common Lisp @code{ceiling} function, which is analogous to @code{floor} except that it rounds the argument or quotient of the arguments up toward plus infinity. The remainder will be between 0 and minus @var{r}. @end defun -@defun truncate* number &optional divisor +@defun cl-truncate number &optional divisor This function implements the Common Lisp @code{truncate} function, which is analogous to @code{floor} except that it rounds the argument or quotient of the arguments toward zero. Thus it is -equivalent to @code{floor*} if the argument or quotient is -positive, or to @code{ceiling*} otherwise. The remainder has +equivalent to @code{cl-floor} if the argument or quotient is +positive, or to @code{cl-ceiling} otherwise. The remainder has the same sign as @var{number}. @end defun -@defun round* number &optional divisor +@defun cl-round number &optional divisor This function implements the Common Lisp @code{round} function, which is analogous to @code{floor} except that it rounds the argument or quotient of the arguments to the nearest integer. @@ -3417,21 +3416,22 @@ In the case of a tie (the argument or quotient is exactly halfway between two integers), it rounds to the even integer. @end defun -@defun mod* number divisor +@defun cl-mod number divisor This function returns the same value as the second return value -of @code{floor}. +of @code{cl-floor}. @end defun -@defun rem* number divisor +@defun cl-rem number divisor This function returns the same value as the second return value -of @code{truncate}. +of @code{cl-truncate}. @end defun +@c FIXME this stuff is probably no longer of interest to anyone. These definitions are compatible with those in the Quiroz -@file{cl.el} package, except that this package appends @samp{*} -to certain function names to avoid conflicts with existing -Emacs functions, and that the mechanism for returning -multiple values is different. +@file{cl.el} package, except that +@c this package appends @samp{*} to certain function names to avoid +@c conflicts with existing Emacs functions, and that +the mechanism for returning multiple values is different. @iftex @secno=8 @@ -3447,7 +3447,7 @@ algorithm, which is much more likely to give statistically clean random numbers than the simple generators supplied by many operating systems. -@defun random* number &optional state +@defun cl-random number &optional state This function returns a random nonnegative number less than @var{number}, and of the same type (either integer or floating-point). The @var{state} argument should be a @code{random-state} object @@ -3458,21 +3458,21 @@ function modifies this state object as a side effect. If @code{random-state} object. @end defun -@defvar *random-state* +@defvar cl--random-state This variable contains the system ``default'' @code{random-state} -object, used for calls to @code{random*} that do not specify an +object, used for calls to @code{cl-random} that do not specify an alternative state object. Since any number of programs in the -Emacs process may be accessing @code{*random-state*} in interleaved +Emacs process may be accessing @code{cl--random-state} in interleaved fashion, the sequence generated from this variable will be irreproducible for all intents and purposes. @end defvar -@defun make-random-state &optional state +@defun cl-make-random-state &optional state This function creates or copies a @code{random-state} object. If @var{state} is omitted or @code{nil}, it returns a new copy of -@code{*random-state*}. This is a copy in the sense that future -sequences of calls to @code{(random* @var{n})} and -@code{(random* @var{n} @var{s})} (where @var{s} is the new +@code{cl--random-state}. This is a copy in the sense that future +sequences of calls to @code{(cl-random @var{n})} and +@code{(cl-random @var{n} @var{s})} (where @var{s} is the new random-state object) will return identical sequences of random numbers. @@ -3487,13 +3487,13 @@ different sequence of random numbers. It is valid to print a @code{random-state} object to a buffer or file and later read it back with @code{read}. If a program wishes to use a sequence of pseudo-random numbers which can be reproduced -later for debugging, it can call @code{(make-random-state t)} to +later for debugging, it can call @code{(cl-make-random-state t)} to get a new sequence, then print this sequence to a file. When the program is later rerun, it can read the original run's random-state from the file. @end defun -@defun random-state-p object +@defun cl-random-state-p object This predicate returns @code{t} if @var{object} is a @code{random-state} object, or @code{nil} otherwise. @end defun @@ -3512,7 +3512,7 @@ function that must be called before the parameters can be used. @defun cl-float-limits This function makes sure that the Common Lisp floating-point parameters -like @code{most-positive-float} have been initialized. Until it is +like @code{cl-most-positive-float} have been initialized. Until it is called, these parameters will be @code{nil}. If this version of Emacs does not support floats, the parameters will remain @code{nil}. If the parameters have already been initialized, the function returns @@ -3530,50 +3530,50 @@ precisions, it has families of constants like floating-point precision, so this package omits the precision word from the constants' names. -@defvar most-positive-float +@defvar cl-most-positive-float This constant equals the largest value a Lisp float can hold. For those systems whose arithmetic supports infinities, this is the largest @emph{finite} value. For IEEE machines, the value is approximately @code{1.79e+308}. @end defvar -@defvar most-negative-float +@defvar cl-most-negative-float This constant equals the most-negative value a Lisp float can hold. -(It is assumed to be equal to @code{(- most-positive-float)}.) +(It is assumed to be equal to @code{(- cl-most-positive-float)}.) @end defvar -@defvar least-positive-float +@defvar cl-least-positive-float This constant equals the smallest Lisp float value greater than zero. For IEEE machines, it is about @code{4.94e-324} if denormals are supported or @code{2.22e-308} if not. @end defvar -@defvar least-positive-normalized-float +@defvar cl-least-positive-normalized-float This constant equals the smallest @emph{normalized} Lisp float greater than zero, i.e., the smallest value for which IEEE denormalization will not result in a loss of precision. For IEEE machines, this value is about @code{2.22e-308}. For machines that do not support the concept of denormalization and gradual underflow, this constant -will always equal @code{least-positive-float}. +will always equal @code{cl-least-positive-float}. @end defvar -@defvar least-negative-float -This constant is the negative counterpart of @code{least-positive-float}. +@defvar cl-least-negative-float +This constant is the negative counterpart of @code{cl-least-positive-float}. @end defvar -@defvar least-negative-normalized-float +@defvar cl-least-negative-normalized-float This constant is the negative counterpart of -@code{least-positive-normalized-float}. +@code{cl-least-positive-normalized-float}. @end defvar -@defvar float-epsilon +@defvar cl-float-epsilon This constant is the smallest positive Lisp float that can be added to 1.0 to produce a distinct value. Adding a smaller number to 1.0 will yield 1.0 again due to roundoff. For IEEE machines, epsilon is about @code{2.22e-16}. @end defvar -@defvar float-negative-epsilon +@defvar cl-float-negative-epsilon This is the smallest positive value that can be subtracted from 1.0 to produce a distinct value. For IEEE machines, it is about @code{1.11e-16}. @@ -3590,10 +3590,10 @@ Emacs Lisp includes a few of these, notably @code{elt} and @menu * Sequence Basics:: Arguments shared by all sequence functions. -* Mapping over Sequences:: @code{mapcar*}, @code{mapcan}, @code{map}, @code{every}, etc. -* Sequence Functions:: @code{subseq}, @code{remove*}, @code{substitute}, etc. -* Searching Sequences:: @code{find}, @code{position}, @code{count}, @code{search}, etc. -* Sorting Sequences:: @code{sort*}, @code{stable-sort}, @code{merge}. +* Mapping over Sequences:: @code{cl-mapcar}, @code{cl-mapcan}, @code{cl-map}, @code{cl-every}, etc. +* Sequence Functions:: @code{cl-subseq}, @code{cl-remove}, @code{cl-substitute}, etc. +* Searching Sequences:: @code{cl-find}, @code{cl-position}, @code{cl-count}, @code{cl-search}, etc. +* Sorting Sequences:: @code{cl-sort}, @code{cl-stable-sort}, @code{cl-merge}. @end menu @node Sequence Basics @@ -3607,7 +3607,7 @@ may appear in any order. The @code{:key} argument should be passed either @code{nil}, or a function of one argument. This key function is used as a filter through which the elements of the sequence are seen; for example, -@code{(find x y :key 'car)} is similar to @code{(assoc* x y)}: +@code{(cl-find x y :key 'car)} is similar to @code{(cl-assoc x y)}: It searches for an element of the list whose @code{car} equals @code{x}, rather than for an element which equals @code{x} itself. If @code{:key} is omitted or @code{nil}, the filter is effectively @@ -3632,7 +3632,7 @@ and sequence elements match if the predicate returns true on them (or false in the case of @code{-if-not}). For example: @example -(remove* 0 seq :test '=) @equiv{} (remove-if 'zerop seq) +(cl-remove 0 seq :test '=) @equiv{} (cl-remove-if 'zerop seq) @end example @noindent @@ -3662,14 +3662,14 @@ are called on various elements. Therefore, it is a bad idea to depend on side effects of these functions. For example, @code{:from-end} may cause the sequence to be scanned actually in reverse, or it may be scanned forwards but computing a result ``as if'' it were scanned -backwards. (Some functions, like @code{mapcar*} and @code{every}, +backwards. (Some functions, like @code{cl-mapcar} and @code{cl-every}, @emph{do} specify exactly the order in which the function is called so side effects are perfectly acceptable in those cases.) Strings may contain ``text properties'' as well as character data. Except as noted, it is undefined whether or not text properties are preserved by sequence functions. For -example, @code{(remove* ?A @var{str})} may or may not preserve +example, @code{(cl-remove ?A @var{str})} may or may not preserve the properties of the characters copied from @var{str} into the result. @@ -3681,7 +3681,7 @@ These functions ``map'' the function you specify over the elements of lists or arrays. They are all variations on the theme of the built-in function @code{mapcar}. -@defun mapcar* function seq &rest more-seqs +@defun cl-mapcar function seq &rest more-seqs This function calls @var{function} on successive parallel sets of elements from its argument sequences. Given a single @var{seq} argument it is equivalent to @code{mapcar}; given @var{n} sequences, @@ -3694,86 +3694,87 @@ is always a list. Common Lisp's @code{mapcar} accepts multiple arguments but works only on lists; Emacs Lisp's @code{mapcar} accepts a single sequence -argument. This package's @code{mapcar*} works as a compatible +argument. This package's @code{cl-mapcar} works as a compatible superset of both. @end defun -@defun map result-type function seq &rest more-seqs +@defun cl-map result-type function seq &rest more-seqs This function maps @var{function} over the argument sequences, -just like @code{mapcar*}, but it returns a sequence of type +just like @code{cl-mapcar}, but it returns a sequence of type @var{result-type} rather than a list. @var{result-type} must be one of the following symbols: @code{vector}, @code{string}, @code{list} (in which case the effect is the same as for @code{mapcar*}), or @code{nil} (in which case the results are -thrown away and @code{map} returns @code{nil}). +thrown away and @code{cl-map} returns @code{nil}). @end defun -@defun maplist function list &rest more-lists +@defun cl-maplist function list &rest more-lists This function calls @var{function} on each of its argument lists, then on the @code{cdr}s of those lists, and so on, until the shortest list runs out. The results are returned in the form -of a list. Thus, @code{maplist} is like @code{mapcar*} except +of a list. Thus, @code{cl-maplist} is like @code{cl-mapcar} except that it passes in the list pointers themselves rather than the @code{car}s of the advancing pointers. @end defun +@c FIXME does not exist? @defun cl-mapc function seq &rest more-seqs -This function is like @code{mapcar*}, except that the values returned +This function is like @code{cl-mapcar}, except that the values returned by @var{function} are ignored and thrown away rather than being collected into a list. The return value of @code{cl-mapc} is @var{seq}, the first sequence. This function is more general than the Emacs primitive @code{mapc}. @end defun -@defun mapl function list &rest more-lists -This function is like @code{maplist}, except that it throws away +@defun cl-mapl function list &rest more-lists +This function is like @code{cl-maplist}, except that it throws away the values returned by @var{function}. @end defun -@defun mapcan function seq &rest more-seqs -This function is like @code{mapcar*}, except that it concatenates +@defun cl-mapcan function seq &rest more-seqs +This function is like @code{cl-mapcar}, except that it concatenates the return values (which must be lists) using @code{nconc}, rather than simply collecting them into a list. @end defun -@defun mapcon function list &rest more-lists -This function is like @code{maplist}, except that it concatenates +@defun cl-mapcon function list &rest more-lists +This function is like @code{cl-maplist}, except that it concatenates the return values using @code{nconc}. @end defun -@defun some predicate seq &rest more-seqs +@defun cl-some predicate seq &rest more-seqs This function calls @var{predicate} on each element of @var{seq} in turn; if @var{predicate} returns a non-@code{nil} value, @code{some} returns that value, otherwise it returns @code{nil}. Given several sequence arguments, it steps through the sequences in parallel until the shortest one runs out, just as in -@code{mapcar*}. You can rely on the left-to-right order in which +@code{cl-mapcar}. You can rely on the left-to-right order in which the elements are visited, and on the fact that mapping stops immediately as soon as @var{predicate} returns non-@code{nil}. @end defun -@defun every predicate seq &rest more-seqs +@defun cl-every predicate seq &rest more-seqs This function calls @var{predicate} on each element of the sequence(s) in turn; it returns @code{nil} as soon as @var{predicate} returns @code{nil} for any element, or @code{t} if the predicate was true for all elements. @end defun -@defun notany predicate seq &rest more-seqs +@defun cl-notany predicate seq &rest more-seqs This function calls @var{predicate} on each element of the sequence(s) in turn; it returns @code{nil} as soon as @var{predicate} returns a non-@code{nil} value for any element, or @code{t} if the predicate was @code{nil} for all elements. @end defun -@defun notevery predicate seq &rest more-seqs +@defun cl-notevery predicate seq &rest more-seqs This function calls @var{predicate} on each element of the sequence(s) in turn; it returns a non-@code{nil} value as soon as @var{predicate} returns @code{nil} for any element, or @code{t} if the predicate was true for all elements. @end defun -@defun reduce function seq @t{&key :from-end :start :end :initial-value :key} +@defun cl-reduce function seq @t{&key :from-end :start :end :initial-value :key} This function combines the elements of @var{seq} using an associative binary operation. Suppose @var{function} is @code{*} and @var{seq} is the list @code{(2 3 4 5)}. The first two elements of the list are @@ -3781,16 +3782,16 @@ combined with @code{(* 2 3) = 6}; this is combined with the next element, @code{(* 6 4) = 24}, and that is combined with the final element: @code{(* 24 5) = 120}. Note that the @code{*} function happens to be self-reducing, so that @code{(* 2 3 4 5)} has the same effect as -an explicit call to @code{reduce}. +an explicit call to @code{cl-reduce}. If @code{:from-end} is true, the reduction is right-associative instead of left-associative: @example -(reduce '- '(1 2 3 4)) - @equiv{} (- (- (- 1 2) 3) 4) @result{} -8 -(reduce '- '(1 2 3 4) :from-end t) - @equiv{} (- 1 (- 2 (- 3 4))) @result{} -2 +(cl-reduce '- '(1 2 3 4)) + @equiv{} (- (- (- 1 2) 3) 4) @result{} -8 +(cl-reduce '- '(1 2 3 4) :from-end t) + @equiv{} (- 1 (- 2 (- 3 4))) @result{} -2 @end example If @code{:key} is specified, it is a function of one argument which @@ -3807,7 +3808,7 @@ If the sequence is empty (and there is no initial value), then @end defun All of these mapping operations can be expressed conveniently in -terms of the @code{loop} macro. In compiled code, @code{loop} will +terms of the @code{cl-loop} macro. In compiled code, @code{cl-loop} will be faster since it generates the loop as in-line code with no function calls. @@ -3818,7 +3819,7 @@ function calls. This section describes a number of Common Lisp functions for operating on sequences. -@defun subseq sequence start &optional end +@defun cl-subseq sequence start &optional end This function returns a given subsequence of the argument @var{sequence}, which may be a list, string, or vector. The indices @var{start} and @var{end} must be in range, and @@ -3830,30 +3831,30 @@ with @var{sequence}. As an extension to Common Lisp, @var{start} and/or @var{end} may be negative, in which case they represent a distance back from the end of the sequence. This is for compatibility with -Emacs's @code{substring} function. Note that @code{subseq} is +Emacs's @code{substring} function. Note that @code{cl-subseq} is the @emph{only} sequence function that allows negative @var{start} and @var{end}. -You can use @code{setf} on a @code{subseq} form to replace a +You can use @code{setf} on a @code{cl-subseq} form to replace a specified range of elements with elements from another sequence. -The replacement is done as if by @code{replace}, described below. +The replacement is done as if by @code{cl-replace}, described below. @end defun -@defun concatenate result-type &rest seqs +@defun cl-concatenate result-type &rest seqs This function concatenates the argument sequences together to form a result sequence of type @var{result-type}, one of the symbols @code{vector}, @code{string}, or @code{list}. The arguments are always copied, even in cases such as -@code{(concatenate 'list '(1 2 3))} where the result is +@code{(cl-concatenate 'list '(1 2 3))} where the result is identical to an argument. @end defun -@defun fill seq item @t{&key :start :end} +@defun cl-fill seq item @t{&key :start :end} This function fills the elements of the sequence (or the specified part of the sequence) with the value @var{item}. @end defun -@defun replace seq1 seq2 @t{&key :start1 :end1 :start2 :end2} +@defun cl-replace seq1 seq2 @t{&key :start1 :end1 :start2 :end2} This function copies part of @var{seq2} into part of @var{seq1}. The sequence @var{seq1} is not stretched or resized; the amount of data copied is simply the shorter of the source and destination @@ -3867,7 +3868,7 @@ start and end arguments specify overlapping regions, the effect is undefined. @end defun -@defun remove* item seq @t{&key :test :test-not :key :count :start :end :from-end} +@defun cl-remove item seq @t{&key :test :test-not :key :count :start :end :from-end} This returns a copy of @var{seq} with all elements matching @var{item} removed. The result may share storage with or be @code{eq} to @var{seq} in some circumstances, but the original @@ -3884,25 +3885,25 @@ end of the sequence rather than the beginning (this matters only if @var{count} was also specified). @end defun -@defun delete* item seq @t{&key :test :test-not :key :count :start :end :from-end} +@defun cl-delete item seq @t{&key :test :test-not :key :count :start :end :from-end} This deletes all elements of @var{seq} which match @var{item}. It is a destructive operation. Since Emacs Lisp does not support -stretchable strings or vectors, this is the same as @code{remove*} -for those sequence types. On lists, @code{remove*} will copy the +stretchable strings or vectors, this is the same as @code{cl-remove} +for those sequence types. On lists, @code{cl-remove} will copy the list if necessary to preserve the original list, whereas -@code{delete*} will splice out parts of the argument list. +@code{cl-delete} will splice out parts of the argument list. Compare @code{append} and @code{nconc}, which are analogous non-destructive and destructive list operations in Emacs Lisp. @end defun -@findex remove-if -@findex remove-if-not -@findex delete-if -@findex delete-if-not -The predicate-oriented functions @code{remove-if}, @code{remove-if-not}, -@code{delete-if}, and @code{delete-if-not} are defined similarly. +@findex cl-remove-if +@findex cl-remove-if-not +@findex cl-delete-if +@findex cl-delete-if-not +The predicate-oriented functions @code{cl-remove-if}, @code{cl-remove-if-not}, +@code{cl-delete-if}, and @code{cl-delete-if-not} are defined similarly. -@defun remove-duplicates seq @t{&key :test :test-not :key :start :end :from-end} +@defun cl-remove-duplicates seq @t{&key :test :test-not :key :start :end :from-end} This function returns a copy of @var{seq} with duplicate elements removed. Specifically, if two elements from the sequence match according to the @code{:test}, @code{:test-not}, and @code{:key} @@ -3912,30 +3913,30 @@ is true, the leftmost one is retained instead. If @code{:start} or examined or removed. @end defun -@defun delete-duplicates seq @t{&key :test :test-not :key :start :end :from-end} +@defun cl-delete-duplicates seq @t{&key :test :test-not :key :start :end :from-end} This function deletes duplicate elements from @var{seq}. It is -a destructive version of @code{remove-duplicates}. +a destructive version of @code{cl-remove-duplicates}. @end defun -@defun substitute new old seq @t{&key :test :test-not :key :count :start :end :from-end} +@defun cl-substitute new old seq @t{&key :test :test-not :key :count :start :end :from-end} This function returns a copy of @var{seq}, with all elements matching @var{old} replaced with @var{new}. The @code{:count}, @code{:start}, @code{:end}, and @code{:from-end} arguments may be used to limit the number of substitutions made. @end defun -@defun nsubstitute new old seq @t{&key :test :test-not :key :count :start :end :from-end} -This is a destructive version of @code{substitute}; it performs +@defun cl-nsubstitute new old seq @t{&key :test :test-not :key :count :start :end :from-end} +This is a destructive version of @code{cl-substitute}; it performs the substitution using @code{setcar} or @code{aset} rather than by returning a changed copy of the sequence. @end defun -@findex substitute-if -@findex substitute-if-not -@findex nsubstitute-if -@findex nsubstitute-if-not -The @code{substitute-if}, @code{substitute-if-not}, @code{nsubstitute-if}, -and @code{nsubstitute-if-not} functions are defined similarly. For +@findex cl-substitute-if +@findex cl-substitute-if-not +@findex cl-nsubstitute-if +@findex cl-nsubstitute-if-not +The @code{cl-substitute-if}, @code{cl-substitute-if-not}, @code{cl-nsubstitute-if}, +and @code{cl-nsubstitute-if-not} functions are defined similarly. For these, a @var{predicate} is given in place of the @var{old} argument. @node Searching Sequences @@ -3943,9 +3944,9 @@ these, a @var{predicate} is given in place of the @var{old} argument. @noindent These functions search for elements or subsequences in a sequence. -(See also @code{member*} and @code{assoc*}; @pxref{Lists}.) +(See also @code{cl-member} and @code{cl-assoc}; @pxref{Lists}.) -@defun find item seq @t{&key :test :test-not :key :start :end :from-end} +@defun cl-find item seq @t{&key :test :test-not :key :start :end :from-end} This function searches @var{seq} for an element matching @var{item}. If it finds a match, it returns the matching element. Otherwise, it returns @code{nil}. It returns the leftmost match, unless @@ -3954,30 +3955,30 @@ match. The @code{:start} and @code{:end} arguments may be used to limit the range of elements that are searched. @end defun -@defun position item seq @t{&key :test :test-not :key :start :end :from-end} -This function is like @code{find}, except that it returns the +@defun cl-position item seq @t{&key :test :test-not :key :start :end :from-end} +This function is like @code{cl-find}, except that it returns the integer position in the sequence of the matching item rather than the item itself. The position is relative to the start of the sequence as a whole, even if @code{:start} is non-zero. The function returns @code{nil} if no matching element was found. @end defun -@defun count item seq @t{&key :test :test-not :key :start :end} +@defun cl-count item seq @t{&key :test :test-not :key :start :end} This function returns the number of elements of @var{seq} which match @var{item}. The result is always a nonnegative integer. @end defun -@findex find-if -@findex find-if-not -@findex position-if -@findex position-if-not -@findex count-if -@findex count-if-not -The @code{find-if}, @code{find-if-not}, @code{position-if}, -@code{position-if-not}, @code{count-if}, and @code{count-if-not} +@findex cl-find-if +@findex cl-find-if-not +@findex cl-position-if +@findex cl-position-if-not +@findex cl-count-if +@findex cl-count-if-not +The @code{cl-find-if}, @code{cl-find-if-not}, @code{cl-position-if}, +@code{cl-position-if-not}, @code{cl-count-if}, and @code{cl-count-if-not} functions are defined similarly. -@defun mismatch seq1 seq2 @t{&key :test :test-not :key :start1 :end1 :start2 :end2 :from-end} +@defun cl-mismatch seq1 seq2 @t{&key :test :test-not :key :start1 :end1 :start2 :end2 :from-end} This function compares the specified parts of @var{seq1} and @var{seq2}. If they are the same length and the corresponding elements match (according to @code{:test}, @code{:test-not}, @@ -3992,11 +3993,11 @@ to left starting at @code{(1- @var{end1})} and @code{(1- @var{end2})}. If the sequences differ, then one plus the index of the rightmost difference (relative to @var{seq1}) is returned. -An interesting example is @code{(mismatch str1 str2 :key 'upcase)}, +An interesting example is @code{(cl-mismatch str1 str2 :key 'upcase)}, which compares two strings case-insensitively. @end defun -@defun search seq1 seq2 @t{&key :test :test-not :key :from-end :start1 :end1 :start2 :end2} +@defun cl-search seq1 seq2 @t{&key :test :test-not :key :from-end :start1 :end1 :start2 :end2} This function searches @var{seq2} for a subsequence that matches @var{seq1} (or part of it specified by @code{:start1} and @code{:end1}.) Only matches which fall entirely within the region @@ -4010,7 +4011,7 @@ function finds the @emph{rightmost} matching subsequence. @node Sorting Sequences @section Sorting Sequences -@defun sort* seq predicate @t{&key :key} +@defun clsort seq predicate @t{&key :key} This function sorts @var{seq} into increasing order as determined by using @var{predicate} to compare pairs of elements. @var{predicate} should return true (non-@code{nil}) if and only if its first argument @@ -4025,7 +4026,7 @@ accepts a @code{:key} argument which is used to preprocess data fed to the @var{predicate} function. For example, @example -(setq data (sort* data 'string-lessp :key 'downcase)) +(setq data (cl-sort data 'string-lessp :key 'downcase)) @end example @noindent @@ -4035,25 +4036,25 @@ would be useful for sorting association lists. It should only be a simple accessor though, it's used heavily in the current implementation. -The @code{sort*} function is destructive; it sorts lists by actually +The @code{cl-sort} function is destructive; it sorts lists by actually rearranging the @code{cdr} pointers in suitable fashion. @end defun -@defun stable-sort seq predicate @t{&key :key} +@defun cl-stable-sort seq predicate @t{&key :key} This function sorts @var{seq} @dfn{stably}, meaning two elements which are equal in terms of @var{predicate} are guaranteed not to be rearranged out of their original order by the sort. -In practice, @code{sort*} and @code{stable-sort} are equivalent +In practice, @code{cl-sort} and @code{cl-stable-sort} are equivalent in Emacs Lisp because the underlying @code{sort} function is stable by default. However, this package reserves the right to -use non-stable methods for @code{sort*} in the future. +use non-stable methods for @code{cl-sort} in the future. @end defun -@defun merge type seq1 seq2 predicate @t{&key :key} +@defun cl-merge type seq1 seq2 predicate @t{&key :key} This function merges two sequences @var{seq1} and @var{seq2} by interleaving their elements. The result sequence, of type @var{type} -(in the sense of @code{concatenate}), has length equal to the sum +(in the sense of @code{cl-concatenate}), has length equal to the sum of the lengths of the two input sequences. The sequences may be modified destructively. Order of elements within @var{seq1} and @var{seq2} is preserved in the interleaving; elements of the two @@ -4073,10 +4074,10 @@ a merged sequence which is (stably) sorted according to The functions described here operate on lists. @menu -* List Functions:: @code{caddr}, @code{first}, @code{list*}, etc. -* Substitution of Expressions:: @code{subst}, @code{sublis}, etc. -* Lists as Sets:: @code{member*}, @code{adjoin}, @code{union}, etc. -* Association Lists:: @code{assoc*}, @code{rassoc*}, @code{acons}, @code{pairlis}. +* List Functions:: @code{cl-caddr}, @code{cl-first}, @code{cl-list*}, etc. +* Substitution of Expressions:: @code{cl-subst}, @code{cl-sublis}, etc. +* Lists as Sets:: @code{cl-member}, @code{cl-adjoin}, @code{cl-union}, etc. +* Association Lists:: @code{cl-assoc}, @code{cl-rassoc}, @code{cl-acons}, @code{cl-pairlis}. @end menu @node List Functions @@ -4086,7 +4087,7 @@ The functions described here operate on lists. This section describes a number of simple operations on lists, i.e., chains of cons cells. -@defun caddr x +@defun cl-caddr x This function is equivalent to @code{(car (cdr (cdr @var{x})))}. Likewise, this package defines all 28 @code{c@var{xxx}r} functions where @var{xxx} is up to four @samp{a}s and/or @samp{d}s. @@ -4094,24 +4095,24 @@ All of these functions are @code{setf}-able, and calls to them are expanded inline by the byte-compiler for maximum efficiency. @end defun -@defun first x +@defun cl-first x This function is a synonym for @code{(car @var{x})}. Likewise, -the functions @code{second}, @code{third}, @dots{}, through -@code{tenth} return the given element of the list @var{x}. +the functions @code{cl-second}, @code{cl-third}, @dots{}, through +@code{cl-tenth} return the given element of the list @var{x}. @end defun -@defun rest x +@defun cl-rest x This function is a synonym for @code{(cdr @var{x})}. @end defun -@defun endp x +@defun cl-endp x Common Lisp defines this function to act like @code{null}, but signaling an error if @code{x} is neither a @code{nil} nor a -cons cell. This package simply defines @code{endp} as a synonym +cons cell. This package simply defines @code{cl-endp} as a synonym for @code{null}. @end defun -@defun list-length x +@defun cl-list-length x This function returns the length of list @var{x}, exactly like @code{(length @var{x})}, except that if @var{x} is a circular list (where the cdr-chain forms a loop rather than terminating @@ -4119,38 +4120,35 @@ with @code{nil}), this function returns @code{nil}. (The regular @code{length} function would get stuck if given a circular list.) @end defun -@defun list* arg &rest others +@defun cl-list* arg &rest others This function constructs a list of its arguments. The final argument becomes the @code{cdr} of the last cell constructed. -Thus, @code{(list* @var{a} @var{b} @var{c})} is equivalent to +Thus, @code{(cl-list* @var{a} @var{b} @var{c})} is equivalent to @code{(cons @var{a} (cons @var{b} @var{c}))}, and -@code{(list* @var{a} @var{b} nil)} is equivalent to +@code{(cl-list* @var{a} @var{b} nil)} is equivalent to @code{(list @var{a} @var{b})}. - -(Note that this function really is called @code{list*} in Common -Lisp; it is not a name invented for this package like @code{member*} -or @code{defun*}.) @end defun -@defun ldiff list sublist +@defun cl-ldiff list sublist If @var{sublist} is a sublist of @var{list}, i.e., is @code{eq} to one of the cons cells of @var{list}, then this function returns a copy of the part of @var{list} up to but not including -@var{sublist}. For example, @code{(ldiff x (cddr x))} returns +@var{sublist}. For example, @code{(cl-ldiff x (cddr x))} returns the first two elements of the list @code{x}. The result is a copy; the original @var{list} is not modified. If @var{sublist} is not a sublist of @var{list}, a copy of the entire @var{list} is returned. @end defun -@defun copy-list list +@defun cl-copy-list list This function returns a copy of the list @var{list}. It copies dotted lists like @code{(1 2 . 3)} correctly. @end defun @defun copy-tree x &optional vecp This function returns a copy of the tree of cons cells @var{x}. -Unlike @code{copy-sequence} (and its alias @code{copy-list}), +@c FIXME? cl-copy-list is not an alias of copy-sequence. +Unlike @code{copy-sequence} (and its alias @code{cl-copy-list}), which copies only along the @code{cdr} direction, this function copies (recursively) along both the @code{car} and the @code{cdr} directions. If @var{x} is not a cons cell, the function simply @@ -4159,7 +4157,7 @@ is true, this function copies vectors (recursively) as well as cons cells. @end defun -@defun tree-equal x y @t{&key :test :test-not :key} +@defun cl-tree-equal x y @t{&key :test :test-not :key} This function compares two trees of cons cells. If @var{x} and @var{y} are both cons cells, their @code{car}s and @code{cdr}s are compared recursively. If neither @var{x} nor @var{y} is a cons @@ -4177,10 +4175,10 @@ applied to the elements of both trees. @xref{Sequences}. @noindent These functions substitute elements throughout a tree of cons -cells. (@xref{Sequence Functions}, for the @code{substitute} +cells. (@xref{Sequence Functions}, for the @code{cl-substitute} function, which works on just the top-level elements of a list.) -@defun subst new old tree @t{&key :test :test-not :key} +@defun cl-subst new old tree @t{&key :test :test-not :key} This function substitutes occurrences of @var{old} with @var{new} in @var{tree}, a tree of cons cells. It returns a substituted tree, which will be a copy except that it may share storage with @@ -4195,21 +4193,21 @@ The @code{:key} function is applied to the elements of the tree but not to @var{old}. @end defun -@defun nsubst new old tree @t{&key :test :test-not :key} -This function is like @code{subst}, except that it works by +@defun cl-nsubst new old tree @t{&key :test :test-not :key} +This function is like @code{cl-subst}, except that it works by destructive modification (by @code{setcar} or @code{setcdr}) rather than copying. @end defun -@findex subst-if -@findex subst-if-not -@findex nsubst-if -@findex nsubst-if-not -The @code{subst-if}, @code{subst-if-not}, @code{nsubst-if}, and -@code{nsubst-if-not} functions are defined similarly. +@findex cl-subst-if +@findex cl-subst-if-not +@findex cl-nsubst-if +@findex cl-nsubst-if-not +The @code{cl-subst-if}, @code{cl-subst-if-not}, @code{cl-nsubst-if}, and +@code{cl-nsubst-if-not} functions are defined similarly. -@defun sublis alist tree @t{&key :test :test-not :key} -This function is like @code{subst}, except that it takes an +@defun cl-sublis alist tree @t{&key :test :test-not :key} +This function is like @code{cl-subst}, except that it takes an association list @var{alist} of @var{old}-@var{new} pairs. Each element of the tree (after applying the @code{:key} function, if any), is compared with the @code{car}s of @@ -4217,8 +4215,8 @@ function, if any), is compared with the @code{car}s of @code{cdr}. @end defun -@defun nsublis alist tree @t{&key :test :test-not :key} -This is a destructive version of @code{sublis}. +@defun cl-nsublis alist tree @t{&key :test :test-not :key} +This is a destructive version of @code{cl-sublis}. @end defun @node Lists as Sets @@ -4228,7 +4226,7 @@ This is a destructive version of @code{sublis}. These functions perform operations on lists which represent sets of elements. -@defun member* item list @t{&key :test :test-not :key} +@defun cl-member item list @t{&key :test :test-not :key} This function searches @var{list} for an element matching @var{item}. If a match is found, it returns the cons cell whose @code{car} was the matching element. Otherwise, it returns @code{nil}. Elements @@ -4236,34 +4234,33 @@ are compared by @code{eql} by default; you can use the @code{:test}, @code{:test-not}, and @code{:key} arguments to modify this behavior. @xref{Sequences}. -Note that this function's name is suffixed by @samp{*} to avoid -the incompatible @code{member} function defined in Emacs. -(That function uses @code{equal} for comparisons; it is equivalent -to @code{(member* @var{item} @var{list} :test 'equal)}.) +The standard Emacs lisp function @code{member} uses @code{equal} for +comparisons; it is equivalent to @code{(cl-member @var{item} @var{list} +:test 'equal)}. @end defun -@findex member-if -@findex member-if-not -The @code{member-if} and @code{member-if-not} functions +@findex cl-member-if +@findex cl-member-if-not +The @code{cl-member-if} and @code{cl-member-if-not} functions analogously search for elements which satisfy a given predicate. -@defun tailp sublist list +@defun cl-tailp sublist list This function returns @code{t} if @var{sublist} is a sublist of @var{list}, i.e., if @var{sublist} is @code{eql} to @var{list} or to any of its @code{cdr}s. @end defun -@defun adjoin item list @t{&key :test :test-not :key} +@defun cl-adjoin item list @t{&key :test :test-not :key} This function conses @var{item} onto the front of @var{list}, like @code{(cons @var{item} @var{list})}, but only if @var{item} -is not already present on the list (as determined by @code{member*}). +is not already present on the list (as determined by @code{cl-member}). If a @code{:key} argument is specified, it is applied to @var{item} as well as to the elements of @var{list} during the search, on the reasoning that @var{item} is ``about'' to become part of the list. @end defun -@defun union list1 list2 @t{&key :test :test-not :key} +@defun cl-union list1 list2 @t{&key :test :test-not :key} This function combines two lists which represent sets of items, returning a list that represents the union of those two sets. The result list will contain all items which appear in @var{list1} @@ -4275,46 +4272,46 @@ result list. The order of elements in the result list is also undefined. @end defun -@defun nunion list1 list2 @t{&key :test :test-not :key} -This is a destructive version of @code{union}; rather than copying, +@defun cl-nunion list1 list2 @t{&key :test :test-not :key} +This is a destructive version of @code{cl-union}; rather than copying, it tries to reuse the storage of the argument lists if possible. @end defun -@defun intersection list1 list2 @t{&key :test :test-not :key} +@defun cl-intersection list1 list2 @t{&key :test :test-not :key} This function computes the intersection of the sets represented by @var{list1} and @var{list2}. It returns the list of items which appear in both @var{list1} and @var{list2}. @end defun -@defun nintersection list1 list2 @t{&key :test :test-not :key} -This is a destructive version of @code{intersection}. It +@defun cl-nintersection list1 list2 @t{&key :test :test-not :key} +This is a destructive version of @code{cl-intersection}. It tries to reuse storage of @var{list1} rather than copying. It does @emph{not} reuse the storage of @var{list2}. @end defun -@defun set-difference list1 list2 @t{&key :test :test-not :key} +@defun cl-set-difference list1 list2 @t{&key :test :test-not :key} This function computes the ``set difference'' of @var{list1} and @var{list2}, i.e., the set of elements that appear in @var{list1} but @emph{not} in @var{list2}. @end defun -@defun nset-difference list1 list2 @t{&key :test :test-not :key} -This is a destructive @code{set-difference}, which will try +@defun cl-nset-difference list1 list2 @t{&key :test :test-not :key} +This is a destructive @code{cl-set-difference}, which will try to reuse @var{list1} if possible. @end defun -@defun set-exclusive-or list1 list2 @t{&key :test :test-not :key} +@defun cl-set-exclusive-or list1 list2 @t{&key :test :test-not :key} This function computes the ``set exclusive or'' of @var{list1} and @var{list2}, i.e., the set of elements that appear in exactly one of @var{list1} and @var{list2}. @end defun -@defun nset-exclusive-or list1 list2 @t{&key :test :test-not :key} -This is a destructive @code{set-exclusive-or}, which will try +@defun cl-nset-exclusive-or list1 list2 @t{&key :test :test-not :key} +This is a destructive @code{cl-set-exclusive-or}, which will try to reuse @var{list1} and @var{list2} if possible. @end defun -@defun subsetp list1 list2 @t{&key :test :test-not :key} +@defun cl-subsetp list1 list2 @t{&key :test :test-not :key} This function checks whether @var{list1} represents a subset of @var{list2}, i.e., whether every element of @var{list1} also appears in @var{list2}. @@ -4328,7 +4325,7 @@ An @dfn{association list} is a list representing a mapping from one set of values to another; any list whose elements are cons cells is an association list. -@defun assoc* item a-list @t{&key :test :test-not :key} +@defun cl-assoc item a-list @t{&key :test :test-not :key} This function searches the association list @var{a-list} for an element whose @code{car} matches (in the sense of @code{:test}, @code{:test-not}, and @code{:key}, or by comparison with @code{eql}) @@ -4340,27 +4337,27 @@ are not cons cells. (This corresponds to the behavior of elements of @var{a-list} to be an error.) @end defun -@defun rassoc* item a-list @t{&key :test :test-not :key} +@defun cl-rassoc item a-list @t{&key :test :test-not :key} This function searches for an element whose @code{cdr} matches @var{item}. If @var{a-list} represents a mapping, this applies the inverse of the mapping to @var{item}. @end defun -@findex assoc-if -@findex assoc-if-not -@findex rassoc-if -@findex rassoc-if-not -The @code{assoc-if}, @code{assoc-if-not}, @code{rassoc-if}, -and @code{rassoc-if-not} functions are defined similarly. +@findex cl-assoc-if +@findex cl-assoc-if-not +@findex cl-rassoc-if +@findex cl-rassoc-if-not +The @code{cl-assoc-if}, @code{cl-assoc-if-not}, @code{cl-rassoc-if}, +and @code{cl-rassoc-if-not} functions are defined similarly. Two simple functions for constructing association lists are: -@defun acons key value alist +@defun cl-acons key value alist This is equivalent to @code{(cons (cons @var{key} @var{value}) @var{alist})}. @end defun -@defun pairlis keys values &optional alist -This is equivalent to @code{(nconc (mapcar* 'cons @var{keys} @var{values}) +@defun cl-pairlis keys values &optional alist +This is equivalent to @code{(nconc (cl-mapcar 'cons @var{keys} @var{values}) @var{alist})}. @end defun @@ -4382,15 +4379,15 @@ system provides no way to create new distinct types, this package implements structures as vectors (or lists upon request) with a special ``tag'' symbol to identify them. -@defspec defstruct name slots@dots{} -The @code{defstruct} form defines a new structure type called +@defspec cl-defstruct name slots@dots{} +The @code{cl-defstruct} form defines a new structure type called @var{name}, with the specified @var{slots}. (The @var{slots} may begin with a string which documents the structure type.) In the simplest case, @var{name} and each of the @var{slots} are symbols. For example, @example -(defstruct person name age sex) +(cl-defstruct person name age sex) @end example @noindent @@ -4401,7 +4398,7 @@ and @code{(person-sex @var{p})}. You can also change these slots by using @code{setf} on any of these place forms: @example -(incf (person-age birthday-boy)) +(cl-incf (person-age birthday-boy)) @end example You can create a new @code{person} by calling @code{make-person}, @@ -4465,10 +4462,10 @@ the slot's value is determined when the object is created and does not change afterward. @example -(defstruct person - (name nil :read-only t) - age - (sex 'unknown)) +(cl-defstruct person + (name nil :read-only t) + age + (sex 'unknown)) @end example Any slot options other than @code{:read-only} are ignored. @@ -4480,10 +4477,10 @@ by arguments. (By contrast, slot options are key-value pairs not enclosed in lists.) @example -(defstruct (person (:constructor create-person) - (:type list) - :named) - name age sex) +(cl-defstruct (person (:constructor create-person) + (:type list) + :named) + name age sex) @end example The following structure options are recognized. @@ -4529,15 +4526,15 @@ as well unless you disable it with a simple-format @code{:constructor} option. @example -(defstruct - (person - (:constructor nil) ; no default constructor - (:constructor new-person (name sex &optional (age 0))) - (:constructor new-hound (&key (name "Rover") - (dog-years 0) - &aux (age (* 7 dog-years)) - (sex 'canine)))) - name age sex) +(cl-defstruct + (person + (:constructor nil) ; no default constructor + (:constructor new-person (name sex &optional (age 0))) + (:constructor new-hound (&key (name "Rover") + (dog-years 0) + &aux (age (* 7 dog-years)) + (sex 'canine)))) + name age sex) @end example The first constructor here takes its arguments positionally rather @@ -4576,7 +4573,7 @@ only if they used the default predicate name. @item :include This option implements a very limited form of C++-style inheritance. The argument is the name of another structure type previously -created with @code{defstruct}. The effect is to cause the new +created with @code{cl-defstruct}. The effect is to cause the new structure type to inherit all of the included structure's slots (plus, of course, any new slots described by this struct's slot descriptors). The new structure is considered a ``specialization'' @@ -4589,12 +4586,12 @@ slot descriptors for slots in the included structure, possibly with modified default values. Borrowing an example from Steele: @example -(defstruct person name (age 0) sex) - @result{} person -(defstruct (astronaut (:include person (age 45))) - helmet-size - (favorite-beverage 'tang)) - @result{} astronaut +(cl-defstruct person name (age 0) sex) + @result{} person +(cl-defstruct (astronaut (:include person (age 45))) + helmet-size + (favorite-beverage 'tang)) + @result{} astronaut (setq joe (make-person :name "Joe")) @result{} [cl-struct-person "Joe" 0 nil] @@ -4650,9 +4647,9 @@ use named vectors. Therefore, @code{:named} is only useful in conjunction with @code{:type}. @example -(defstruct (person1) name age sex) -(defstruct (person2 (:type list) :named) name age sex) -(defstruct (person3 (:type list)) name age sex) +(cl-defstruct (person1) name age sex) +(cl-defstruct (person2 (:type list) :named) name age sex) +(cl-defstruct (person3 (:type list)) name age sex) (setq p1 (make-person1)) @result{} [cl-struct-person1 nil nil nil] @@ -4669,7 +4666,7 @@ conjunction with @code{:type}. @result{} error: function person3-p undefined @end example -Since unnamed structures don't have tags, @code{defstruct} is not +Since unnamed structures don't have tags, @code{cl-defstruct} is not able to make a useful predicate for recognizing them. Also, accessors like @code{person3-name} will be generated but they will not be able to do any type checking. The @code{person3-name} @@ -4691,7 +4688,7 @@ of the included type and the first new slot. @end table @end defspec -Except as noted, the @code{defstruct} facility of this package is +Except as noted, the @code{cl-defstruct} facility of this package is entirely compatible with that of Common Lisp. @node Assertions @@ -4708,10 +4705,10 @@ If the optimization property @code{speed} has been set to 3, and away the following assertions. Because assertions might be optimized away, it is a bad idea for them to include side-effects. -@defspec assert test-form [show-args string args@dots{}] +@defspec cl-assert test-form [show-args string args@dots{}] This form verifies that @var{test-form} is true (i.e., evaluates to a non-@code{nil} value). If so, it returns @code{nil}. If the test -is not satisfied, @code{assert} signals an error. +is not satisfied, @code{cl-assert} signals an error. A default error message will be supplied which includes @var{test-form}. You can specify a different error message by including a @var{string} @@ -4724,7 +4721,7 @@ will also include all non-constant arguments of the top-level @var{form}. For example: @example -(assert (> x 10) t "x is too small: %d") +(cl-assert (> x 10) t "x is too small: %d") @end example This usage of @var{show-args} is an extension to Common Lisp. In @@ -4734,16 +4731,16 @@ error. Since Emacs Lisp does not support continuable errors, it makes no sense to specify @var{places}. @end defspec -@defspec check-type form type [string] +@defspec cl-check-type form type [string] This form verifies that @var{form} evaluates to a value of type -@var{type}. If so, it returns @code{nil}. If not, @code{check-type} +@var{type}. If so, it returns @code{nil}. If not, @code{cl-check-type} signals a @code{wrong-type-argument} error. The default error message lists the erroneous value along with @var{type} and @var{form} themselves. If @var{string} is specified, it is included in the error message in place of @var{type}. For example: @example -(check-type x (integer 1 *) "a positive integer") +(cl-check-type x (integer 1 *) "a positive integer") @end example @xref{Type Predicates}, for a description of the type specifiers @@ -4757,6 +4754,7 @@ user to modify @var{place}. The following error-related macro is also defined: +@c FIXME standard for some time. @defspec ignore-errors forms@dots{} This executes @var{forms} exactly like a @code{progn}, except that errors are ignored during the @var{forms}. More precisely, if @@ -4772,14 +4770,14 @@ returns the result of the last @var{form}. @appendixsec Macros @noindent -Many of the advanced features of this package, such as @code{defun*}, -@code{loop}, and @code{setf}, are implemented as Lisp macros. In +Many of the advanced features of this package, such as @code{cl-defun}, +@code{cl-loop}, and @code{setf}, are implemented as Lisp macros. In byte-compiled code, these complex notations will be expanded into equivalent Lisp code which is simple and efficient. For example, the forms @example -(incf i n) +(cl-incf i n) (push x (car p)) @end example @@ -4794,13 +4792,13 @@ are expanded at compile-time to the Lisp forms @noindent which are the most efficient ways of doing these respective operations in Lisp. Thus, there is no performance penalty for using the more -readable @code{incf} and @code{push} forms in your compiled code. +readable @code{cl-incf} and @code{push} forms in your compiled code. @emph{Interpreted} code, on the other hand, must expand these macros every time they are executed. For this reason it is strongly recommended that code making heavy use of macros be compiled. (The features labeled ``Special Form'' instead of ``Function'' in -this manual are macros.) A loop using @code{incf} a hundred times +this manual are macros.) A loop using @code{cl-incf} a hundred times will execute considerably faster if compiled, and will also garbage-collect less because the macro expansion will not have to be generated, used, and thrown away a hundred times. @@ -4824,36 +4822,36 @@ and type @kbd{C-x C-e} immediately after the closing parenthesis; the expansion @example -(block nil - (let* ((x 0) - (G1004 nil)) - (while (< x 10) - (setq G1004 (cons x G1004)) - (setq x (+ x 1))) - (nreverse G1004))) +(cl-block nil + (let* ((x 0) + (G1004 nil)) + (while (< x 10) + (setq G1004 (cons x G1004)) + (setq x (+ x 1))) + (nreverse G1004))) @end example @noindent -will be inserted into the buffer. (The @code{block} macro is +will be inserted into the buffer. (The @code{cl-block} macro is expanded differently in the interpreter and compiler, so @code{cl-prettyexpand} just leaves it alone. The temporary -variable @code{G1004} was created by @code{gensym}.) +variable @code{G1004} was created by @code{cl-gensym}.) If the optional argument @var{full} is true, then @emph{all} -macros are expanded, including @code{block}, @code{eval-when}, +macros are expanded, including @code{cl-block}, @code{cl-eval-when}, and compiler macros. Expansion is done as if @var{form} were a top-level form in a file being compiled. For example, @example -(cl-prettyexpand '(pushnew 'x list)) - @print{} (setq list (adjoin 'x list)) -(cl-prettyexpand '(pushnew 'x list) t) +(cl-prettyexpand '(cl-pushnew 'x list)) + @print{} (setq list (cl-adjoin 'x list)) +(cl-prettyexpand '(cl-pushnew 'x list) t) @print{} (setq list (if (memq 'x list) list (cons 'x list))) -(cl-prettyexpand '(caddr (member* 'a list)) t) +(cl-prettyexpand '(caddr (cl-member 'a list)) t) @print{} (car (cdr (cdr (memq 'a list)))) @end example -Note that @code{adjoin}, @code{caddr}, and @code{member*} all +Note that @code{cl-adjoin}, @code{cl-caddr}, and @code{cl-member} all have built-in compiler macros to optimize them in common cases. @end defun @@ -4875,22 +4873,22 @@ phrase ``it is an error if'' to indicate a situation which is not supposed to arise in complying programs; implementations are strongly encouraged but not required to signal an error in these situations. This package sometimes omits such error checking in the interest of -compactness and efficiency. For example, @code{do} variable +compactness and efficiency. For example, @code{cl-do} variable specifiers are supposed to be lists of one, two, or three forms; extra forms are ignored by this package rather than signaling a -syntax error. The @code{endp} function is simply a synonym for +syntax error. The @code{cl-endp} function is simply a synonym for @code{null} in this package. Functions taking keyword arguments will accept an odd number of arguments, treating the trailing keyword as if it were followed by the value @code{nil}. -Argument lists (as processed by @code{defun*} and friends) +Argument lists (as processed by @code{cl-defun} and friends) @emph{are} checked rigorously except for the minor point just mentioned; in particular, keyword arguments are checked for validity, and @code{&allow-other-keys} and @code{:allow-other-keys} are fully implemented. Keyword validity checking is slightly time consuming (though not too bad in byte-compiled code); you can use @code{&allow-other-keys} to omit this check. Functions -defined in this package such as @code{find} and @code{member*} +defined in this package such as @code{cl-find} and @code{cl-member} do check their keyword arguments for validity. @ifinfo @@ -4904,10 +4902,10 @@ do check their keyword arguments for validity. Use of the optimizing Emacs compiler is highly recommended; many of the Common Lisp macros emit code which can be improved by optimization. In particular, -@code{block}s (whether explicit or implicit in constructs like -@code{defun*} and @code{loop}) carry a fair run-time penalty; the -optimizing compiler removes @code{block}s which are not actually -referenced by @code{return} or @code{return-from} inside the block. +@code{cl-block}s (whether explicit or implicit in constructs like +@code{cl-defun} and @code{cl-loop}) carry a fair run-time penalty; the +optimizing compiler removes @code{cl-block}s which are not actually +referenced by @code{cl-return} or @code{cl-return-from} inside the block. @node Common Lisp Compatibility @appendix Common Lisp Compatibility @@ -4916,20 +4914,22 @@ referenced by @code{return} or @code{return-from} inside the block. Following is a list of all known incompatibilities between this package and Common Lisp as documented in Steele (2nd edition). +@ignore Certain function names, such as @code{member}, @code{assoc}, and @code{floor}, were already taken by (incompatible) Emacs Lisp functions; this package appends @samp{*} to the names of its Common Lisp versions of these functions. +@end ignore -The word @code{defun*} is required instead of @code{defun} in order +The word @code{cl-defun} is required instead of @code{defun} in order to use extended Common Lisp argument lists in a function. Likewise, -@code{defmacro*} and @code{function*} are versions of those forms +@code{cl-defmacro} and @code{cl-function} are versions of those forms which understand full-featured argument lists. The @code{&whole} keyword does not work in @code{defmacro} argument lists (except inside recursive argument lists). The @code{equal} predicate does not distinguish -between IEEE floating-point plus and minus zero. The @code{equalp} +between IEEE floating-point plus and minus zero. The @code{cl-equalp} predicate has several differences with Common Lisp; @pxref{Predicates}. The @code{setf} mechanism is entirely compatible, except that @@ -4937,21 +4937,21 @@ setf-methods return a list of five values rather than five values directly. Also, the new ``@code{setf} function'' concept (typified by @code{(defun (setf foo) @dots{})}) is not implemented. -The @code{do-all-symbols} form is the same as @code{do-symbols} +The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} with no @var{obarray} argument. In Common Lisp, this form would iterate over all symbols in all packages. Since Emacs obarrays are not a first-class package mechanism, there is no way for -@code{do-all-symbols} to locate any but the default obarray. +@code{cl-do-all-symbols} to locate any but the default obarray. -The @code{loop} macro is complete except that @code{loop-finish} +The @code{cl-loop} macro is complete except that @code{loop-finish} and type specifiers are unimplemented. The multiple-value return facility treats lists as multiple values, since Emacs Lisp cannot support multiple return values directly. The macros will be compatible with Common Lisp if @code{values} or @code{values-list} is always used to return to -a @code{multiple-value-bind} or other multiple-value receiver; -if @code{values} is used without @code{multiple-value-@dots{}} +a @code{cl-multiple-value-bind} or other multiple-value receiver; +if @code{values} is used without @code{cl-multiple-value-@dots{}} or vice-versa the effect will be different from Common Lisp. Many Common Lisp declarations are ignored, and others match @@ -4960,17 +4960,18 @@ example, local @code{special} declarations, which are purely advisory in Emacs Lisp, do not rigorously obey the scoping rules set down in Steele's book. -The variable @code{*gensym-counter*} starts out with a pseudo-random +The variable @code{cl--gensym-counter} starts out with a pseudo-random value rather than with zero. This is to cope with the fact that generated symbols become interned when they are written to and loaded back from a file. -The @code{defstruct} facility is compatible, except that structures +The @code{cl-defstruct} facility is compatible, except that structures are of type @code{:type vector :named} by default rather than some special, distinct type. Also, the @code{:type} slot option is ignored. -The second argument of @code{check-type} is treated differently. +The second argument of @code{cl-check-type} is treated differently. +@c FIXME Time to remove this? @node Old CL Compatibility @appendix Old CL Compatibility @@ -4989,6 +4990,7 @@ is more predictable though more noticeably different from Common Lisp. The @code{defkeyword} form and @code{keywordp} function are not implemented in this package. +@ignore The @code{member}, @code{floor}, @code{ceiling}, @code{truncate}, @code{round}, @code{mod}, and @code{rem} functions are suffixed by @samp{*} in this package to avoid collision with existing @@ -4998,6 +5000,7 @@ causing serious portability problems. (Some more recent versions of the Quiroz package changed the names to @code{cl-member}, etc.; this package defines the latter names as aliases for @code{member*}, etc.) +@end ignore Certain functions in the old package which were buggy or inconsistent with the Common Lisp standard are incompatible with the conforming @@ -5006,9 +5009,9 @@ were synonyms for @code{eq} and @code{memq} in that package, @code{setf} failed to preserve correct order of evaluation of its arguments, etc. Finally, unlike the older package, this package is careful to -prefix all of its internal names with @code{cl-}. Except for a +prefix all of its internal names with @code{cl--}. Except for a few functions which are explicitly defined as additional features -(such as @code{floatp-safe} and @code{letf}), this package does not +(such as @code{cl-floatp-safe} and @code{letf}), this package does not export any non-@samp{cl-} symbols which are not also part of Common Lisp. @@ -5267,7 +5270,7 @@ where a more iteratively-minded programmer might write one of these forms: @example -(let ((total 0)) (dolist (x my-list) (incf total x)) total) +(let ((total 0)) (dolist (x my-list) (cl-incf total x)) total) (loop for x in my-list sum x) @end example From 4e79d09a237fe27c0a3d79ddb67642389f414614 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Oct 2012 06:17:36 -0400 Subject: [PATCH 017/109] Auto-commit of generated files. --- autogen/config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 . */ /* Enable compile-time and run-time bounds-checking, and some warnings, without upsetting glibc 2.15+. */ - #if defined __OPTIMIZE__ && __OPTIMIZE__ + #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ # define _FORTIFY_SOURCE 2 #endif From e7b987069126f8a59db97eb6639066ae2f645207 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 24 Oct 2012 15:46:38 +0200 Subject: [PATCH 018/109] nt/config.nt: Sync with autogen/config.in. --- nt/ChangeLog | 4 ++++ nt/config.nt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index 94d2ce18551..c915ee40bb6 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2012-10-24 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + 2012-10-17 Eli Zaretskii * 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 . */ /* Enable compile-time and run-time bounds-checking, and some warnings, without upsetting glibc 2.15+. */ - #if defined __OPTIMIZE__ && __OPTIMIZE__ + #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ # define _FORTIFY_SOURCE 2 #endif @@ -701,7 +701,7 @@ along with GNU Emacs. If not, see . */ Mac OS X. */ #undef HAVE_NS -/* Define to use native Windows GUI. */ +/* Define to use native MS Windows GUI. */ #define HAVE_NTGUI 1 /* Define to 1 if libotf has OTF_get_variation_glyphs. */ From cd99601878e97578ecd8e2209feeda275a3a13f5 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 24 Oct 2012 22:38:49 +0800 Subject: [PATCH 019/109] Document some Emacs 24.3 changes. * doc/emacs/dired.texi (Dired Deletion, Marks vs Flags): Document Emacs 24.3 changes to the mark and unmark commands. (Comparison in Dired): Document chages to dired-diff. Remove M-=, which is no longer bound to dired-backup-diff. * doc/emacs/mule.texi (Text Coding): set-buffer-file-coding-system can now be invoked from the mode line. * lisp/dired.el (dired-mark, dired-unmark, dired-flag-file-deletion): Doc fix. --- doc/emacs/ChangeLog | 10 +++++ doc/emacs/dired.texi | 84 ++++++++++++++++++++------------------- doc/emacs/mule.texi | 16 +++++--- doc/lispref/ChangeLog | 6 +++ doc/lispref/minibuf.texi | 21 +++++----- doc/lispref/nonascii.texi | 8 +++- etc/NEWS | 58 ++++++++++++++------------- lisp/ChangeLog | 3 ++ lisp/dired.el | 16 +++++--- 9 files changed, 133 insertions(+), 89 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 9a71ed5b272..b911153f080 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,13 @@ +2012-10-24 Chong Yidong + + * mule.texi (Text Coding): set-buffer-file-coding-system can now + be invoked from the mode line. + + * dired.texi (Dired Deletion, Marks vs Flags): Document Emacs 24.3 + changes to the mark and unmark commands. + (Comparison in Dired): Document chages to dired-diff. Remove M-=, + which is no longer bound to dired-backup-diff. + 2012-10-23 Bastien Guerry * text.texi (Org Authoring): Use a comma after @ref to avoid the diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 0dcded78364..8babbcb89ea 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -167,13 +167,14 @@ deletion, then delete the files that were flagged. @table @kbd @item d -Flag this file for deletion. +Flag this file for deletion (@code{dired-flag-file-deletion}). @item u -Remove deletion flag on this line. +Remove the deletion flag (@code{dired-unmark}). @item @key{DEL} -Move point to previous line and remove the deletion flag on that line. +Move point to previous line and remove the deletion flag on that line +(@code{dired-unmark-backward}). @item x -Delete the files that are flagged for deletion. +Delete files flagged for deletion (@code{dired-do-flagged-delete}). @end table @kindex d @r{(Dired)} @@ -182,8 +183,12 @@ Delete the files that are flagged for deletion. the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The deletion flag is visible as a @samp{D} at the beginning of the line. This command moves point to the next line, so that repeated @kbd{d} -commands flag successive files. A numeric argument serves as a repeat -count. +commands flag successive files. A numeric prefix argument serves as a +repeat count; a negative count means to flag preceding files. + + If the region is active, the @kbd{d} command flags all files in the +region for deletion; in this case, the command does not move point, +and ignores any prefix argument. @kindex u @r{(Dired deletion)} @kindex DEL @r{(Dired)} @@ -194,14 +199,17 @@ can remove deletion flags using the commands @kbd{u} and @key{DEL}. @kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes flags rather than making flags. @key{DEL} (@code{dired-unmark-backward}) moves upward, removing flags; it is -like @kbd{u} with argument @minus{}1. +like @kbd{u} with argument @minus{}1. A numeric prefix argument to +either command serves as a repeat count, with a negative count meaning +to unflag in the opposite direction. If the region is active, these +commands instead unflag all files in the region, without moving point. @kindex x @r{(Dired)} @findex dired-do-flagged-delete - To delete the flagged files, type @kbd{x} -(@code{dired-do-flagged-delete}). This command first displays a list -of all the file names flagged for deletion, and requests confirmation -with @kbd{yes}. If you confirm, Dired deletes the flagged files, then + To delete flagged files, type @kbd{x} +(@code{dired-do-flagged-delete}). This command displays a list of all +the file names flagged for deletion, and requests confirmation with +@kbd{yes}. If you confirm, Dired deletes the flagged files, then deletes their lines from the text of the Dired buffer. The Dired buffer, with somewhat fewer lines, remains selected. @@ -387,10 +395,11 @@ and unflag files.) @kindex m @r{(Dired)} @kindex * m @r{(Dired)} @findex dired-mark -Mark the current file with @samp{*} (@code{dired-mark}). With a numeric -argument @var{n}, mark the next @var{n} files starting with the current -file. (If @var{n} is negative, mark the previous @minus{}@var{n} -files.) +Mark the current file with @samp{*} (@code{dired-mark}). If the +region is active, mark all files in the region instead; otherwise, if +a numeric argument @var{n} is supplied, mark the next @var{n} files +instead, starting with the current file (if @var{n} is negative, mark +the previous @minus{}@var{n} files). @item * * @kindex * * @r{(Dired)} @@ -426,7 +435,11 @@ and @file{..} (@code{dired-mark-subdir-files}). @kindex u @r{(Dired)} @kindex * u @r{(Dired)} @findex dired-unmark -Remove any mark on this line (@code{dired-unmark}). +Remove any mark on this line (@code{dired-unmark}). If the region is +active, unmark all files in the region instead; otherwise, if a +numeric argument @var{n} is supplied, unmark the next @var{n} files +instead, starting with the current file (if @var{n} is negative, +unmark the previous @minus{}@var{n} files). @item @key{DEL} @itemx * @key{DEL} @@ -434,7 +447,11 @@ Remove any mark on this line (@code{dired-unmark}). @findex dired-unmark-backward @cindex unmarking files (in Dired) Move point to previous line and remove any mark on that line -(@code{dired-unmark-backward}). +(@code{dired-unmark-backward}). If the region is active, unmark all +files in the region instead; otherwise, if a numeric argument @var{n} +is supplied, unmark the @var{n} preceding files instead, starting with +the current file (if @var{n} is negative, unmark the next +@minus{}@var{n} files). @item * ! @itemx U @@ -936,32 +953,19 @@ default. @cindex file comparison (in Dired) @cindex compare files (in Dired) - Here are two Dired commands that compare specified files using -@code{diff}. They show the output in a buffer using Diff mode -(@pxref{Comparing Files}). - -@table @kbd -@item = @findex dired-diff @kindex = @r{(Dired)} -Compare the current file (the file at point) with another file (the -file at the mark) using the @code{diff} program (@code{dired-diff}). -The file at the mark is the first argument of @code{diff}, and the -file at point is the second argument. This refers to the ordinary -Emacs mark, not Dired marks; use @kbd{C-@key{SPC}} -(@code{set-mark-command}) to set the mark at the first file's line -(@pxref{Setting Mark}). + The @kbd{=} (@code{dired-diff}) command compares the current file +(the file at point) with another file (read using the minibuffer) +using the @command{diff} program. The file specified with the +minibuffer is the first argument of @command{diff}, and file at point +is the second argument. The output of the @command{diff} program is +shown in a buffer using Diff mode (@pxref{Comparing Files}). -@findex dired-backup-diff -@kindex M-= @r{(Dired)} -@item M-= -Compare the current file with its latest backup file -(@code{dired-backup-diff}). If the current file is itself a backup, -compare it with the file it is a backup of; this way, you can compare -a file with any one of its backups. - -The backup file is the first file given to @code{diff}. -@end table + If the region is active, the default for the file read using the +minibuffer is the file at the mark (i.e.@: the ordinary Emacs mark, +not a Dired mark; @pxref{Setting Mark}). Otherwise, if the file at +point has a backup file (@pxref{Backup}), that is the default. @node Subdirectories in Dired @section Subdirectories in Dired diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 1dfae79c788..d7ed6cc488f 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -1040,12 +1040,16 @@ decoding it using coding system @var{right} instead. @findex set-buffer-file-coding-system The command @kbd{C-x @key{RET} f} (@code{set-buffer-file-coding-system}) sets the file coding system for -the current buffer---in other words, it says which coding system to -use when saving or reverting the visited file. You specify which -coding system using the minibuffer. If you specify a coding system -that cannot handle all of the characters in the buffer, Emacs warns -you about the troublesome characters when you actually save the -buffer. +the current buffer (i.e.@: the coding system to use when saving or +reverting the file). You specify which coding system using the +minibuffer. You can also invoke this command by clicking with +@kbd{Mouse-3} on the coding system indicator in the mode line +(@pxref{Mode Line}). + + If you specify a coding system that cannot handle all the characters +in the buffer, Emacs will warn you about the troublesome characters, +and ask you to choose another coding system, when you try to save the +buffer (@pxref{Output Coding}). @cindex specify end-of-line conversion You can also use this command to specify the end-of-line conversion diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index bed74bb688a..25dee5212e5 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -11,6 +11,12 @@ 2012-10-24 Chong Yidong + * minibuf.texi (Text from Minibuffer): Document read-regexp + changes. + + * nonascii.texi (Selecting a Representation): Document + set-buffer-multibyte changes. + * keymaps.texi (Toolkit Differences): Node deleted. (Easy Menu): New node. diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 39b4fca3b25..79c83144f77 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -211,22 +211,25 @@ This function works by calling the @end smallexample @end defun -@defun read-regexp prompt &optional default +@defun read-regexp prompt &optional default history This function reads a regular expression as a string from the minibuffer and returns it. The argument @var{prompt} is used as in -@code{read-from-minibuffer}. The keymap used is -@code{minibuffer-local-map}, and @code{regexp-history} is used as the -history list (@pxref{Minibuffer History, regexp-history}). +@code{read-from-minibuffer}. The optional argument @var{default} specifies a default value to return if the user enters null input; it should be a string, or @code{nil}, which is equivalent to an empty string. -In addition, @code{read-regexp} collects a few useful candidates for -input and passes them to @code{read-from-minibuffer}, to make them -available to the user as the ``future minibuffer history list'' -(@pxref{Minibuffer History, future list,, emacs, The GNU Emacs -Manual}). These candidates are: +The optional argument @var{history}, if non-@code{nil}, is a symbol +specifying a minibuffer history list to use (@pxref{Minibuffer +History}). If it is omitted or @code{nil}, the history list defaults +to @code{regexp-history}. + +@code{read-regexp} also collects a few useful candidates for input and +passes them to @code{read-from-minibuffer}, to make them available to +the user as the ``future minibuffer history list'' (@pxref{Minibuffer +History, future list,, emacs, The GNU Emacs Manual}). These +candidates are: @itemize @minus @item 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 (including overlays, text properties and markers) so that they cover the same text as they did before. -You cannot use @code{set-buffer-multibyte} on an indirect buffer, -because indirect buffers always inherit the representation of the +This function signals an error if the buffer is narrowed, since the +narrowing might have occurred in the middle of multibyte character +sequences. + +This function also signals an error if the buffer is an indirect +buffer. An indirect buffer always inherits the representation of its base buffer. @end defun diff --git a/etc/NEWS b/etc/NEWS index 27957e6787d..d891e28e7ef 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -104,26 +104,19 @@ been adding them there, put them somewhere else, eg site-lisp. * Changes in Emacs 24.3 -** minibuffer-electric-default-mode can rewrite (default ...) to [...]. -Just set minibuffer-eldef-shorten-default to t before enabling the mode. - +++ ** Most y-or-n prompts now allow you to scroll the selected window. Typing C-v or M-v at a y-or-n prompt scrolls forward or backward respectively, without exiting from the prompt. ---- -** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the -next and previous path separator, respectively. - ** Mode line changes --- *** New option `mode-line-default-help-echo' specifies the help text (shown in a tooltip or in the echo area) for any part of the mode line that does not have its own specialized help text. - -*** You can now click mouse-3 in the coding system indicator to -invokes `set-buffer-file-coding-system'. ++++ +*** You can now click mouse-3 in the coding system indicator to invoke +`set-buffer-file-coding-system'. ** Help changes @@ -139,6 +132,14 @@ correctly. To disable this, set `help-enable-auto-load' to nil. even after their associated libraries have been loaded (and the autoloads have been redefined as functions). +** Minibuffer changes +--- +*** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the +next and previous path separator, respectively. + +*** minibuffer-electric-default-mode can rewrite (default ...) to [...]. +Just set minibuffer-eldef-shorten-default to t before enabling the mode. + ** ImageMagick support, if available, is automatically enabled. It is no longer necessary to call `imagemagick-register-types' explicitly to install ImageMagick image types; that function is called @@ -340,15 +341,15 @@ rather than making them unbound. *** New option `compilation-always-kill'. ** Customize - +--- *** `custom-reset-button-menu' now defaults to t. - +--- *** Non-option variables are never matched in `customize-apropos' and `customize-apropos-options' (i.e. the prefix argument does nothing for these commands now). ** Desktop - +--- *** `desktop-path' no longer includes the "." directory. Desktop files are now located in ~/.emacs.d by default. @@ -402,22 +403,23 @@ whitespace problems introduced by the diff. *** `dired-do-async-shell-command' executes each file sequentially if the command ends in `;' (when operating on multiple files). Otherwise, it executes the command on each file in parallel. - +--- *** Typing M-n in the minibuffer of `dired-do-chmod', `dired-do-chgrp', `dired-do-chown', `dired-do-touch' pulls the file attributes of the file at point. - ++++ *** When the region is active, `m' (`dired-mark'), `u' (`dired-unmark'), `DEL' (`dired-unmark-backward'), `d' (`dired-flag-file-deletion') mark/unmark/flag all files in the active region. - ++++ *** The minibuffer default for `=' (`dired-diff) has changed. It is now the backup file for the file at point, if one exists. In Transient Mark mode the default is the file at the active mark. - ++++ *** `M-=' is no longer bound to `dired-backup-diff' in Dired buffers. The global binding for `M-=', `count-words-region' is in effect. +--- ** Ediff now uses the same color scheme as Diff mode. ** erc will look up server/channel names via auth-source and use the @@ -428,9 +430,9 @@ See `flymake-fringe-indicator-position', `flymake-error-bitmap' and `flymake-warning-bitmap'. ** Follow mode - +--- *** The obsolete variable `follow-mode-off-hook' has been removed. - +--- *** Follow mode no longer works by using advice. The option `follow-intercept-processes' has been removed. @@ -673,6 +675,7 @@ gnus-notifications.el, mm-archive.el * Incompatible Lisp Changes in Emacs 24.3 ++++ ** set-buffer-multibyte now signals an error in narrowed buffers. +++ @@ -772,9 +775,18 @@ systems), or based on memory allocations. ** CL-style generalized variables are now in core Elisp. `setf' is autoloaded; `push' and `pop' accept generalized variables. ++++ ** `defun' also accepts a (declare DECLS) form, like `defmacro'. The interpretation of the DECLS is determined by `defun-declarations-alist'. +** Minibuffer ++++ +*** `read-regexp' has a new argument HISTORY; the first argument PROMPT +of `read-regexp' accepts a string ending with a colon and space, and its +second argument DEFAULTS can be a list of strings accessible via M-n +in the minibuffer ahead of other hard-coded useful regexp-related values. +More commands use `read-regexp' now to read their regexp arguments. + ** Completion *** New function `completion-table-with-quoting' to handle completion @@ -797,14 +809,6 @@ to work out which code is doing something. *** New var `inhibit-debugger', automatically set to prevent accidental recursive invocations. -** Minibuffer - -*** `read-regexp' has a new argument HISTORY; the first argument PROMPT -of `read-regexp' accepts a string ending with a colon and space, and its -second argument DEFAULTS can be a list of strings accessible via M-n -in the minibuffer ahead of other hard-coded useful regexp-related values. -More commands use `read-regexp' now to read their regexp arguments. - ** Window changes *** The functions get-lru-window, get-mru-window and get-largest-window diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b709c76c74..9b40dbf6458 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-24 Chong Yidong + * dired.el (dired-mark, dired-unmark, dired-flag-file-deletion): + Doc fix. + * emacs-lisp/easymenu.el (easy-menu-define): Doc fix (Bug#12628). 2012-10-24 Stefan Monnier diff --git a/lisp/dired.el b/lisp/dired.el index a4bc16caebf..9094ce08f0a 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3107,10 +3107,11 @@ argument or confirmation)." (forward-line 1)))) (defun dired-mark (arg) - "Mark the current (or next ARG) files. + "Mark the file at point in the Dired buffer. +If the region is active, mark all files in the region. +Otherwise, with a prefix arg, mark files on the next ARG lines. + If on a subdir headerline, mark all its files except `.' and `..'. -If the region is active in Transient Mark mode, mark all files -in the active region. Use \\[dired-unmark-all-files] to remove all marks and \\[dired-unmark] on a subdir to remove the marks in @@ -3136,7 +3137,10 @@ this subdir." (function (lambda () (delete-char 1) (insert dired-marker-char)))))))) (defun dired-unmark (arg) - "Unmark the current (or next ARG) files. + "Unmark the file at point in the Dired buffer. +If the region is active, unmark all files in the region. +Otherwise, with a prefix arg, unmark files on the next ARG lines. + If looking at a subdir, unmark all its files except `.' and `..'. If the region is active in Transient Mark mode, unmark all files in the active region." @@ -3146,7 +3150,9 @@ in the active region." (defun dired-flag-file-deletion (arg) "In Dired, flag the current line's file for deletion. -With prefix arg, repeat over several lines. +If the region is active, flag all files in the region. +Otherwise, with a prefix arg, flag files on the next ARG lines. + If on a subdir headerline, flag all its files except `.' and `..'. If the region is active in Transient Mark mode, flag all files in the active region." From a4b6d7c66e00ad781e9103e9908f1fd61f31ca2b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 24 Oct 2012 22:50:30 +0800 Subject: [PATCH 020/109] * time.el (display-time-world-mode): Derive from special-mode. (display-time-world): Use display-buffer. (display-time-world-mode-map): Variable deleted. Fixes: debbugs:12708 --- lisp/ChangeLog | 6 ++++++ lisp/time.el | 15 ++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b40dbf6458..1ca082a52ad 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-10-24 Chong Yidong + + * time.el (display-time-world-mode): Derive from special-mode. + (display-time-world): Use display-buffer (Bug#12708). + (display-time-world-mode-map): Variable deleted. + 2012-10-24 Chong Yidong * dired.el (dired-mark, dired-unmark, dired-flag-file-deletion): diff --git a/lisp/time.el b/lisp/time.el index fe3cdbb57be..c08fadd4b4e 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." :type 'integer :version "23.1") -(defvar display-time-world-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "q" 'kill-this-buffer) - map) - "Keymap of Display Time World mode.") - ;;;###autoload (defun display-time () "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." 'display-time-event-handler))) -(define-derived-mode display-time-world-mode nil "World clock" +(define-derived-mode display-time-world-mode special-mode "World clock" "Major mode for buffer that displays times in various time zones. See `display-time-world'." (setq show-trailing-whitespace nil)) @@ -562,10 +556,9 @@ To turn off the world time display, go to that window and type `q'." (not (get-buffer display-time-world-buffer-name))) (run-at-time t display-time-world-timer-second 'display-time-world-timer)) (with-current-buffer (get-buffer-create display-time-world-buffer-name) - (display-time-world-display display-time-world-list)) - (pop-to-buffer display-time-world-buffer-name) - (fit-window-to-buffer) - (display-time-world-mode)) + (display-time-world-display display-time-world-list) + (display-buffer display-time-world-buffer-name) + (display-time-world-mode))) (defun display-time-world-timer () (if (get-buffer display-time-world-buffer-name) From c28885aede510603835f3b21059ac59e0d6aa095 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Wed, 24 Oct 2012 23:04:12 +0800 Subject: [PATCH 021/109] Fix error in previous merge from Org. * lisp/org/org-lparse.el: Move some hooks from org-lparse to org-do-lparse. Fixes: debbugs:12718 --- lisp/org/ChangeLog | 5 +++++ lisp/org/org-lparse.el | 26 ++++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index ef40c9316cf..b234021e8a5 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,3 +1,8 @@ +2012-10-24 Jambunathan K + + * org-lparse.el: Move some hooks from org-lparse to org-do-lparse + (Bug#12718). + 2012-09-30 Abdó Roig-Maranges * org-html.el (org-export-html-preprocess) diff --git a/lisp/org/org-lparse.el b/lisp/org/org-lparse.el index 7024912050a..8dac907195a 100644 --- a/lisp/org/org-lparse.el +++ b/lisp/org/org-lparse.el @@ -435,10 +435,6 @@ PUB-DIR specifies the publishing directory." (let* ((org-lparse-backend (intern native-backend)) (org-lparse-other-backend (and target-backend (intern target-backend)))) - (add-hook 'org-export-preprocess-hook - 'org-lparse-strip-experimental-blocks-maybe) - (add-hook 'org-export-preprocess-after-blockquote-hook - 'org-lparse-preprocess-after-blockquote) (unless (org-lparse-backend-is-native-p native-backend) (error "Don't know how to export natively to backend %s" native-backend)) @@ -446,12 +442,7 @@ PUB-DIR specifies the publishing directory." (org-lparse-reachable-p native-backend target-backend)) (error "Don't know how to export to backend %s %s" target-backend (format "via %s" native-backend))) - (run-hooks 'org-export-first-hook) - (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir) - (remove-hook 'org-export-preprocess-hook - 'org-lparse-strip-experimental-blocks-maybe) - (remove-hook 'org-export-preprocess-after-blockquote-hook - 'org-lparse-preprocess-after-blockquote))) + (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir))) (defcustom org-lparse-use-flashy-warning nil "Control flashing of messages logged with `org-lparse-warn'. @@ -594,6 +585,16 @@ version." (setq-default org-deadline-line-regexp org-deadline-line-regexp) (setq-default org-done-keywords org-done-keywords) (setq-default org-maybe-keyword-time-regexp org-maybe-keyword-time-regexp) + + ;; Run first hook. + (run-hooks 'org-export-first-hook) + + ;; Add pre-process hooks. + (add-hook 'org-export-preprocess-hook + 'org-lparse-strip-experimental-blocks-maybe) + (add-hook 'org-export-preprocess-after-blockquote-hook + 'org-lparse-preprocess-after-blockquote) + (let* (hfy-user-sheet-assoc ; let `htmlfontify' know that ; we are interested in ; collecting styles @@ -785,6 +786,11 @@ version." org-lparse-toc href ) + ;; Remove pre-process hooks. + (remove-hook 'org-export-preprocess-hook + 'org-lparse-strip-experimental-blocks-maybe) + (remove-hook 'org-export-preprocess-after-blockquote-hook + 'org-lparse-preprocess-after-blockquote) (let ((inhibit-read-only t)) (org-unmodified From a6c2cc07fcd8bf3c92ad087d1fe76bae1217b2f2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Oct 2012 09:41:59 -0700 Subject: [PATCH 022/109] * Makefile.in (install-man): Don't apply transform to suffix. --- ChangeLog | 4 ++++ Makefile.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1d30382d34d..2f08ce49002 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-10-24 Glenn Morris + + * Makefile.in (install-man): Don't apply transform to suffix. + 2012-10-23 Paul Eggert * configure.ac (_FORTIFY_SOURCE): Do not multiply define (Bug#12714). diff --git a/Makefile.in b/Makefile.in index 5c5d30fb63f..d9e7371cf4a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -622,7 +622,7 @@ install-man: thisdir=`/bin/pwd`; \ cd ${mansrcdir}; \ for page in *.1; do \ - dest=`echo "$${page}" | sed '$(TRANSFORM)'`; \ + dest=`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1; \ (cd $${thisdir}; \ ${INSTALL_DATA} ${mansrcdir}/$${page} $(DESTDIR)${man1dir}/$${dest}); \ ( [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ] ) || continue ; \ From 8bfcb8a6a8b37bc38b2f5407d4ab7eb886b9e79c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Oct 2012 13:25:24 -0400 Subject: [PATCH 023/109] * Makefile.in (install-etc): Don't apply program transform to file suffixes. --- ChangeLog | 3 ++- Makefile.in | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f08ce49002..14a4c4cdfc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2012-10-24 Glenn Morris - * Makefile.in (install-man): Don't apply transform to suffix. + * Makefile.in (install-etc, install-man): + Don't apply program transform to standard file suffixes. 2012-10-23 Paul Eggert diff --git a/Makefile.in b/Makefile.in index d9e7371cf4a..20d680e06ab 100644 --- a/Makefile.in +++ b/Makefile.in @@ -647,7 +647,8 @@ install-etc: ( cd $${thisdir}; ${MKDIR_P} $(DESTDIR)${icondir}/$${dir} ) ; \ for icon in $${dir}/emacs[.-]*; do \ [ -r $${icon} ] || continue ; \ - dest=`echo "$${icon}" | sed -e 's|.*/||' -e '$(TRANSFORM)'` ; \ + ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \ + dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\.$${ext}$$||" -e '$(TRANSFORM)'`.$${ext} ; \ ( cd $${thisdir}; \ ${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${dir}/$${dest} ) \ || exit 1; \ From 576978b40060f089567e5f1db7274d5aabf2c088 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 25 Oct 2012 02:16:41 +0800 Subject: [PATCH 024/109] Revert last change to org-lparse.el --- lisp/org/ChangeLog | 5 ----- lisp/org/org-lparse.el | 26 ++++++++++---------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index b234021e8a5..ef40c9316cf 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,8 +1,3 @@ -2012-10-24 Jambunathan K - - * org-lparse.el: Move some hooks from org-lparse to org-do-lparse - (Bug#12718). - 2012-09-30 Abdó Roig-Maranges * org-html.el (org-export-html-preprocess) diff --git a/lisp/org/org-lparse.el b/lisp/org/org-lparse.el index 8dac907195a..7024912050a 100644 --- a/lisp/org/org-lparse.el +++ b/lisp/org/org-lparse.el @@ -435,6 +435,10 @@ PUB-DIR specifies the publishing directory." (let* ((org-lparse-backend (intern native-backend)) (org-lparse-other-backend (and target-backend (intern target-backend)))) + (add-hook 'org-export-preprocess-hook + 'org-lparse-strip-experimental-blocks-maybe) + (add-hook 'org-export-preprocess-after-blockquote-hook + 'org-lparse-preprocess-after-blockquote) (unless (org-lparse-backend-is-native-p native-backend) (error "Don't know how to export natively to backend %s" native-backend)) @@ -442,7 +446,12 @@ PUB-DIR specifies the publishing directory." (org-lparse-reachable-p native-backend target-backend)) (error "Don't know how to export to backend %s %s" target-backend (format "via %s" native-backend))) - (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir))) + (run-hooks 'org-export-first-hook) + (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir) + (remove-hook 'org-export-preprocess-hook + 'org-lparse-strip-experimental-blocks-maybe) + (remove-hook 'org-export-preprocess-after-blockquote-hook + 'org-lparse-preprocess-after-blockquote))) (defcustom org-lparse-use-flashy-warning nil "Control flashing of messages logged with `org-lparse-warn'. @@ -585,16 +594,6 @@ version." (setq-default org-deadline-line-regexp org-deadline-line-regexp) (setq-default org-done-keywords org-done-keywords) (setq-default org-maybe-keyword-time-regexp org-maybe-keyword-time-regexp) - - ;; Run first hook. - (run-hooks 'org-export-first-hook) - - ;; Add pre-process hooks. - (add-hook 'org-export-preprocess-hook - 'org-lparse-strip-experimental-blocks-maybe) - (add-hook 'org-export-preprocess-after-blockquote-hook - 'org-lparse-preprocess-after-blockquote) - (let* (hfy-user-sheet-assoc ; let `htmlfontify' know that ; we are interested in ; collecting styles @@ -786,11 +785,6 @@ version." org-lparse-toc href ) - ;; Remove pre-process hooks. - (remove-hook 'org-export-preprocess-hook - 'org-lparse-strip-experimental-blocks-maybe) - (remove-hook 'org-export-preprocess-after-blockquote-hook - 'org-lparse-preprocess-after-blockquote) (let ((inhibit-read-only t)) (org-unmodified From 9321d8d7f90c215a691f7768873561f31b7bf429 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 25 Oct 2012 02:26:22 +0800 Subject: [PATCH 025/109] * time.el (display-time-world-display): Wrap delete-char inside inhibit-read-only. --- lisp/ChangeLog | 2 ++ lisp/time.el | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ca082a52ad..a911832a8fb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * time.el (display-time-world-mode): Derive from special-mode. (display-time-world): Use display-buffer (Bug#12708). (display-time-world-mode-map): Variable deleted. + (display-time-world-display): Wrap the final delete-char inside + inhibit-read-only. 2012-10-24 Chong Yidong diff --git a/lisp/time.el b/lisp/time.el index c08fadd4b4e..7473994ffa5 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -543,8 +543,8 @@ See `display-time-world'." (setenv "TZ" old-tz)) (setq fmt (concat "%-" (int-to-string max-width) "s %s\n")) (dolist (timedata (nreverse result)) - (insert (format fmt (car timedata) (cdr timedata))))) - (delete-char -1)) + (insert (format fmt (car timedata) (cdr timedata)))) + (delete-char -1))) ;;;###autoload (defun display-time-world () From 3c92de703166390edbbf9833f282342ce2306699 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 24 Oct 2012 15:40:23 -0400 Subject: [PATCH 026/109] * lisp/minibuffer.el (minibuffer-force-complete): Use one more marker for the temporary-overlay-map command. Fixes: debbugs:12619 --- lisp/ChangeLog | 5 +++++ lisp/minibuffer.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a911832a8fb..07ce9cea1a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-24 Stefan Monnier + + * minibuffer.el (minibuffer-force-complete): Use one more marker + for the temporary-overlay-map command (bug#12619). + 2012-10-24 Chong Yidong * time.el (display-time-world-mode): Derive from special-mode. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 27050042b83..4267fe4db4f 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1114,7 +1114,7 @@ Repeated uses step through the possible completions." ;; FIXME: Need to deal with the extra-size issue here as well. ;; FIXME: ~/src/emacs/t/lisp/minibuffer.el completes to ;; ~/src/emacs/trunk/ and throws away lisp/minibuffer.el. - (let* ((start (field-beginning)) + (let* ((start (copy-marker (field-beginning))) (end (field-end)) ;; (md (completion--field-metadata start)) (all (completion-all-sorted-completions)) From a6880551db39f264286f6ba9bf9735665ea6b967 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Oct 2012 17:53:47 -0400 Subject: [PATCH 027/109] Remove some old information from cl.texi that is no longer relevant * doc/misc/cl.texi (Overview, Multiple Values, Creating Symbols) (Numerical Functions): Say less/nothing about the original cl.el. (Old CL Compatibility): Remove. (Assertions): Remove ignore-errors (standard Elisp for some time). --- doc/misc/ChangeLog | 5 ++ doc/misc/cl.texi | 165 ++++----------------------------------------- 2 files changed, 19 insertions(+), 151 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 76859e09d42..a511ec3b75d 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,5 +1,10 @@ 2012-10-24 Glenn Morris + * cl.texi (Overview, Multiple Values, Creating Symbols) + (Numerical Functions): Say less/nothing about the original cl.el. + (Old CL Compatibility): Remove. + (Assertions): Remove ignore-errors (standard Elisp for some time). + * cl.texi (Basic Setf, Macros, Declarations, Symbols, Numbers) (Sequences, Lists, Structures, Assertions, Efficiency Concerns) (Efficiency Concerns, Efficiency Concerns) diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 5908e94be02..80fe5d2f1c8 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -65,11 +65,10 @@ developing GNU and promoting software freedom.'' * Sequences:: Mapping, functions, searching, sorting. * Lists:: @code{cl-caddr}, @code{cl-sublis}, @code{cl-member}, @code{cl-assoc}, etc. * Structures:: @code{cl-defstruct}. -* Assertions:: @code{cl-check-type}, @code{cl-assert}, @code{ignore-errors}. +* Assertions:: @code{cl-check-type}, @code{cl-assert}. * Efficiency Concerns:: Hints and techniques. * Common Lisp Compatibility:: All known differences with Steele. -* Old CL Compatibility:: All known differences with old cl.el. * Porting Common Lisp:: Hints for porting Common Lisp code. * GNU Free Documentation License:: The license for this documentation. @@ -118,13 +117,11 @@ features. The package described here was originally written by Dave Gillespie, @file{daveg@@synaptics.com}, as a total rewrite of an earlier -1986 @file{cl.el} package by Cesar Quiroz. Most features of the -Quiroz package were retained; any incompatibilities are -noted in the descriptions below. Care has been taken in this -version to ensure that each function is defined efficiently, -concisely, and with minimal impact on the rest of the Emacs -environment. Stefan Monnier added the file @file{cl-lib.el} and -rationalized the namespace for Emacs 24.3. +1986 @file{cl.el} package by Cesar Quiroz. Care has been taken +to ensure that each function is defined efficiently, concisely, and +with minimal impact on the rest of the Emacs environment. Stefan +Monnier added the file @file{cl-lib.el} and rationalized the namespace +for Emacs 24.3. @menu * Usage:: How to use the CL package. @@ -198,12 +195,9 @@ no such restriction on the use of @code{cl-lib}. New code should use @code{cl-lib} rather than @code{cl}. @xref{Naming Conventions}. There is one more file, @file{cl-compat.el}, which defines some -routines from the older CL package that are not otherwise -present in the new package. This includes internal routines -like @code{setelt} and @code{zip-lists}, deprecated features -like @code{defkeyword}, and an emulation of the old-style -multiple-values feature. This file is obsolete and should not be used -in new code. @xref{Old CL Compatibility}. +routines from the older Quiroz CL package that are not otherwise +present in the new package. This file is obsolete and should not be +used in new code. @node Naming Conventions @section Naming Conventions @@ -2875,13 +2869,6 @@ It then sets the @var{var}s to these respective values, as if by in @code{cl-multiple-value-bind}. @end defspec -The older Quiroz package attempted a more faithful (but still -imperfect) emulation of Common Lisp multiple values. The old -method ``usually'' simulated true multiple values quite well, -but under certain circumstances would leave spurious return -values in memory where a later, unrelated @code{cl-multiple-value-bind} -form would see them. - Since a perfect emulation is not feasible in Emacs Lisp, this package opts to keep it as simple and predictable as possible. @@ -3282,12 +3269,11 @@ exists, the function keeps incrementing the counter and trying again until a new symbol is generated. @end defun -The Quiroz @file{cl.el} package also defined a @code{defkeyword} -form for creating self-quoting keyword symbols. This package -automatically creates all keywords that are called for by -@code{&key} argument specifiers, and discourages the use of -keywords as data unrelated to keyword arguments, so the -@code{defkeyword} form has been discontinued. +This package automatically creates all keywords that are called for by +@code{&key} argument specifiers, and discourages the use of keywords +as data unrelated to keyword arguments, so the related function +@code{defkeyword} (to create self-quoting keyword symbols) is not +provided. @node Numbers @chapter Numbers @@ -3426,13 +3412,6 @@ This function returns the same value as the second return value of @code{cl-truncate}. @end defun -@c FIXME this stuff is probably no longer of interest to anyone. -These definitions are compatible with those in the Quiroz -@file{cl.el} package, except that -@c this package appends @samp{*} to certain function names to avoid -@c conflicts with existing Emacs functions, and that -the mechanism for returning multiple values is different. - @iftex @secno=8 @end iftex @@ -4752,18 +4731,6 @@ must be a @var{place} suitable for use by @code{setf}, because user to modify @var{place}. @end defspec -The following error-related macro is also defined: - -@c FIXME standard for some time. -@defspec ignore-errors forms@dots{} -This executes @var{forms} exactly like a @code{progn}, except that -errors are ignored during the @var{forms}. More precisely, if -an error is signaled then @code{ignore-errors} immediately -aborts execution of the @var{forms} and returns @code{nil}. -If the @var{forms} complete successfully, @code{ignore-errors} -returns the result of the last @var{form}. -@end defspec - @node Efficiency Concerns @appendix Efficiency Concerns @@ -4971,110 +4938,6 @@ special, distinct type. Also, the @code{:type} slot option is ignored. The second argument of @code{cl-check-type} is treated differently. -@c FIXME Time to remove this? -@node Old CL Compatibility -@appendix Old CL Compatibility - -@noindent -Following is a list of all known incompatibilities between this package -and the older Quiroz @file{cl.el} package. - -This package's emulation of multiple return values in functions is -incompatible with that of the older package. That package attempted -to come as close as possible to true Common Lisp multiple return -values; unfortunately, it could not be 100% reliable and so was prone -to occasional surprises if used freely. This package uses a simpler -method, namely replacing multiple values with lists of values, which -is more predictable though more noticeably different from Common Lisp. - -The @code{defkeyword} form and @code{keywordp} function are not -implemented in this package. - -@ignore -The @code{member}, @code{floor}, @code{ceiling}, @code{truncate}, -@code{round}, @code{mod}, and @code{rem} functions are suffixed -by @samp{*} in this package to avoid collision with existing -functions in Emacs. The older package simply -redefined these functions, overwriting the built-in meanings and -causing serious portability problems. (Some more -recent versions of the Quiroz package changed the names to -@code{cl-member}, etc.; this package defines the latter names as -aliases for @code{member*}, etc.) -@end ignore - -Certain functions in the old package which were buggy or inconsistent -with the Common Lisp standard are incompatible with the conforming -versions in this package. For example, @code{eql} and @code{member} -were synonyms for @code{eq} and @code{memq} in that package, @code{setf} -failed to preserve correct order of evaluation of its arguments, etc. - -Finally, unlike the older package, this package is careful to -prefix all of its internal names with @code{cl--}. Except for a -few functions which are explicitly defined as additional features -(such as @code{cl-floatp-safe} and @code{letf}), this package does not -export any non-@samp{cl-} symbols which are not also part of Common -Lisp. - -@ifinfo -@example - -@end example -@end ifinfo -@appendixsec The @code{cl-compat} package - -@noindent -The @code{CL} package includes emulations of some features of the -old @file{cl.el}, in the form of a compatibility package -@code{cl-compat}. This file is obsolete and may be removed in future, -so it should not be used in new code. - -The old package defined a number of internal routines without -@code{cl-} prefixes or other annotations. Call to these routines -may have crept into existing Lisp code. @code{cl-compat} -provides emulations of the following internal routines: -@code{pair-with-newsyms}, @code{zip-lists}, @code{unzip-lists}, -@code{reassemble-arglists}, @code{duplicate-symbols-p}, -@code{safe-idiv}. - -Some @code{setf} forms translated into calls to internal -functions that user code might call directly. The functions -@code{setnth}, @code{setnthcdr}, and @code{setelt} fall in -this category; they are defined by @code{cl-compat}, but the -best fix is to change to use @code{setf} properly. - -The @code{cl-compat} file defines the keyword functions -@code{keywordp}, @code{keyword-of}, and @code{defkeyword}, -which are not defined by the new @code{CL} package because the -use of keywords as data is discouraged. - -The @code{build-klist} mechanism for parsing keyword arguments -is emulated by @code{cl-compat}; the @code{with-keyword-args} -macro is not, however, and in any case it's best to change to -use the more natural keyword argument processing offered by -@code{defun*}. - -Multiple return values are treated differently by the two -Common Lisp packages. The old package's method was more -compatible with true Common Lisp, though it used heuristics -that caused it to report spurious multiple return values in -certain cases. The @code{cl-compat} package defines a set -of multiple-value macros that are compatible with the old -CL package; again, they are heuristic in nature, but they -are guaranteed to work in any case where the old package's -macros worked. To avoid name collision with the ``official'' -multiple-value facilities, the ones in @code{cl-compat} have -capitalized names: @code{Values}, @code{Values-list}, -@code{Multiple-value-bind}, etc. - -The functions @code{cl-floor}, @code{cl-ceiling}, @code{cl-truncate}, -and @code{cl-round} are defined by @code{cl-compat} to use the -old-style multiple-value mechanism, just as they did in the old -package. The newer @code{floor*} and friends return their two -results in a list rather than as multiple values. Note that -older versions of the old package used the unadorned names -@code{floor}, @code{ceiling}, etc.; @code{cl-compat} cannot use -these names because they conflict with Emacs built-ins. - @node Porting Common Lisp @appendix Porting Common Lisp From a05cb6e32625355cceef4593321780836b76e348 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Oct 2012 20:58:40 -0400 Subject: [PATCH 028/109] More cl doc updates * doc/misc/cl.texi: Don't mess with the TeX section number counter. Use Texinfo recommended convention for quotes+punctuation. (Overview, Sequence Functions): Rephrase for better line-breaking. (Time of Evaluation, Type Predicates, Modify Macros, Function Bindings) (Macro Bindings, Conditionals, Iteration, Loop Basics) (Random Numbers, Mapping over Sequences, Structures) (Porting Common Lisp): Further updates for cl-lib namespace. (Modify Macros, Declarations, Macro Bindings, Structures): Break long lines in examples. (Dynamic Bindings): Update for changed progv behavior. (Loop Examples, Efficiency Concerns): Markup fixes. (Structures): Remove TeX margin change. * lisp/emacs-lisp/cl-macs.el (cl-progv): Doc fix. * etc/NEWS: Related markup. --- doc/misc/ChangeLog | 15 ++++ doc/misc/cl.texi | 167 +++++++++++++++---------------------- etc/NEWS | 1 + lisp/ChangeLog | 4 + lisp/emacs-lisp/cl-macs.el | 2 +- 5 files changed, 90 insertions(+), 99 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index a511ec3b75d..efc4de8646b 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,18 @@ +2012-10-25 Glenn Morris + + * cl.texi: Don't mess with the TeX section number counter. + Use Texinfo recommended convention for quotes+punctuation. + (Overview, Sequence Functions): Rephrase for better line-breaking. + (Time of Evaluation, Type Predicates, Modify Macros, Function Bindings) + (Macro Bindings, Conditionals, Iteration, Loop Basics) + (Random Numbers, Mapping over Sequences, Structures) + (Porting Common Lisp): Further updates for cl-lib namespace. + (Modify Macros, Declarations, Macro Bindings, Structures): + Break long lines in examples. + (Dynamic Bindings): Update for changed progv behavior. + (Loop Examples, Efficiency Concerns): Markup fixes. + (Structures): Remove TeX margin change. + 2012-10-24 Glenn Morris * cl.texi (Overview, Multiple Values, Creating Symbols) diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 80fe5d2f1c8..d3cc8bb76eb 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -115,17 +115,16 @@ features. @end itemize -The package described here was originally written by Dave Gillespie, -@file{daveg@@synaptics.com}, as a total rewrite of an earlier -1986 @file{cl.el} package by Cesar Quiroz. Care has been taken -to ensure that each function is defined efficiently, concisely, and -with minimal impact on the rest of the Emacs environment. Stefan -Monnier added the file @file{cl-lib.el} and rationalized the namespace -for Emacs 24.3. +This package was originally written by Dave Gillespie, +@file{daveg@@synaptics.com}, as a total rewrite of an earlier 1986 +@file{cl.el} package by Cesar Quiroz. Care has been taken to ensure +that each function is defined efficiently, concisely, and with minimal +impact on the rest of the Emacs environment. Stefan Monnier added the +file @file{cl-lib.el} and rationalized the namespace for Emacs 24.3. @menu * Usage:: How to use the CL package. -* Organization:: The package's five component files. +* Organization:: The package's component files. * Naming Conventions:: Notes on CL function names. @end menu @@ -254,10 +253,6 @@ and the @code{cl-eval-when} construct. * Time of Evaluation:: The @code{cl-eval-when} construct. @end menu -@iftex -@secno=1 -@end iftex - @node Argument Lists @section Argument Lists @@ -566,16 +561,16 @@ last four would have been equivalent to the corresponding @code{setq}s. Note that @code{(cl-eval-when (load eval) @dots{})} is equivalent to @code{(progn @dots{})} in all contexts. The compiler treats certain top-level forms, like @code{defmacro} (sort-of) and -@code{require}, as if they were wrapped in @code{(eval-when +@code{require}, as if they were wrapped in @code{(cl-eval-when (compile load eval) @dots{})}. @end defspec Emacs includes two special forms related to @code{cl-eval-when}. One of these, @code{eval-when-compile}, is not quite equivalent to -any @code{eval-when} construct and is described below. +any @code{cl-eval-when} construct and is described below. The other form, @code{(eval-and-compile @dots{})}, is exactly -equivalent to @samp{(eval-when (compile load eval) @dots{})} and +equivalent to @samp{(cl-eval-when (compile load eval) @dots{})} and so is not itself defined by this package. @defspec eval-when-compile forms... @@ -647,10 +642,6 @@ facts are true or false. @node Type Predicates @section Type Predicates -@noindent -The @code{CL} package defines a version of the Common Lisp @code{typep} -predicate. - @defun cl-typep object type Check if @var{object} is of type @var{type}, where @var{type} is a (quoted) type name of the sort used by Common Lisp. For example, @@ -731,7 +722,7 @@ related to @code{cl-typep}. @defun cl-coerce object type This function attempts to convert @var{object} to the specified @var{type}. If @var{object} is already of that type as determined by -@code{typep}, it is simply returned. Otherwise, certain types of +@code{cl-typep}, it is simply returned. Otherwise, certain types of conversions will be made: If @var{type} is any sequence type (@code{string}, @code{list}, etc.) then @var{object} will be converted to that type if possible. If @var{type} is @@ -1103,7 +1094,8 @@ does, which means the above form is @emph{not} equivalent to the ``obvious'' expansion, @example -(setf (aref vec (cl-incf i)) (1+ (aref vec (cl-incf i)))) ; Wrong! +(setf (aref vec (cl-incf i)) + (1+ (aref vec (cl-incf i)))) ; wrong! @end example @noindent @@ -1128,6 +1120,7 @@ This macro decrements the number stored in @var{place} by one, or by @var{x} if specified. @end defspec +@c FIXME move to lispref, add generalized variables. @defspec pop place This macro removes and returns the first element of the list stored in @var{place}. It is analogous to @code{(prog1 (car @var{place}) @@ -1135,17 +1128,18 @@ in @var{place}. It is analogous to @code{(prog1 (car @var{place}) to evaluate all subforms only once. @end defspec +@c FIXME move to lispref, add generalized variables. @defspec push x place This macro inserts @var{x} at the front of the list stored in @var{place}. It is analogous to @code{(setf @var{place} (cons @var{x} @var{place}))}, except for evaluation of the subforms. @end defspec -@defspec pushnew x place @t{&key :test :test-not :key} +@defspec cl-pushnew x place @t{&key :test :test-not :key} This macro inserts @var{x} at the front of the list stored in @var{place}, but only if @var{x} was not @code{eql} to any existing element of the list. The optional keyword arguments -are interpreted in the same way as for @code{adjoin}. +are interpreted in the same way as for @code{cl-adjoin}. @xref{Lists as Sets}. @end defspec @@ -1169,9 +1163,9 @@ except that the subforms of @var{a}, @var{b}, and @var{c} are actually evaluated only once each and in the apparent order. @end defspec -@defspec rotatef place@dots{} +@defspec cl-rotatef place@dots{} This macro rotates the @var{place}s left by one in circular fashion. -Thus, @code{(rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to +Thus, @code{(cl-rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to @example (psetf @var{a} @var{b} @@ -1181,8 +1175,8 @@ Thus, @code{(rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to @end example @noindent -except for the evaluation of subforms. @code{rotatef} always -returns @code{nil}. Note that @code{(rotatef @var{a} @var{b})} +except for the evaluation of subforms. @code{cl-rotatef} always +returns @code{nil}. Note that @code{(cl-rotatef @var{a} @var{b})} conveniently exchanges @var{a} and @var{b}. @end defspec @@ -1241,40 +1235,40 @@ If the symbol is not bound on entry, it is simply made unbound by @code{makunbound} or @code{fmakunbound} on exit. @end defspec -@defspec letf* (bindings@dots{}) forms@dots{} +@defspec cl-letf* (bindings@dots{}) forms@dots{} This macro is to @code{letf} what @code{let*} is to @code{let}: It does the bindings in sequential rather than parallel order. @end defspec -@defspec callf @var{function} @var{place} @var{args}@dots{} +@defspec cl-callf @var{function} @var{place} @var{args}@dots{} This is the ``generic'' modify macro. It calls @var{function}, which should be an unquoted function name, macro name, or lambda. It passes @var{place} and @var{args} as arguments, and assigns the result back to @var{place}. For example, @code{(cl-incf @var{place} -@var{n})} is the same as @code{(callf + @var{place} @var{n})}. +@var{n})} is the same as @code{(cl-callf + @var{place} @var{n})}. Some more examples: @example -(callf abs my-number) -(callf concat (buffer-name) "<" (int-to-string n) ">") -(callf union happy-people (list joe bob) :test 'same-person) +(cl-callf abs my-number) +(cl-callf concat (buffer-name) "<" (number-to-string n) ">") +(cl-callf cl-union happy-people (list joe bob) :test 'same-person) @end example @xref{Customizing Setf}, for @code{define-modify-macro}, a way to create even more concise notations for modify macros. Note -again that @code{callf} is an extension to standard Common Lisp. +again that @code{cl-callf} is an extension to standard Common Lisp. @end defspec -@defspec callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} -This macro is like @code{callf}, except that @var{place} is +@defspec cl-callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} +This macro is like @code{cl-callf}, except that @var{place} is the @emph{second} argument of @var{function} rather than the first. For example, @code{(push @var{x} @var{place})} is -equivalent to @code{(callf2 cons @var{x} @var{place})}. +equivalent to @code{(cl-callf2 cons @var{x} @var{place})}. @end defspec -The @code{callf} and @code{callf2} macros serve as building -blocks for other macros like @code{cl-incf}, @code{pushnew}, and -@code{define-modify-macro}. The @code{letf} and @code{letf*} +The @code{cl-callf} and @code{cl-callf2} macros serve as building +blocks for other macros like @code{cl-incf}, @code{cl-pushnew}, and +@code{define-modify-macro}. The @code{letf} and @code{cl-letf*} macros are used in the processing of symbol macros; @pxref{Macro Bindings}. @@ -1488,10 +1482,6 @@ or otherwise declared; in newer Common Lisps, this would not be an error since the function @code{(setf @var{func})} might be defined later. -@iftex -@secno=4 -@end iftex - @node Variable Bindings @section Variable Bindings @@ -1524,7 +1514,7 @@ set of variables computed at run-time. The expressions of symbols and values, respectively. The symbols are bound to the corresponding values for the duration of the body @var{form}s. If @var{values} is shorter than @var{symbols}, the last few symbols -are made unbound (as if by @code{makunbound}) inside the body. +are bound to @code{nil}. If @var{symbols} is shorter than @var{values}, the excess values are ignored. @end defspec @@ -1655,7 +1645,7 @@ This form establishes @code{let}-style bindings on the function cells of symbols rather than on the value cells. Each @var{binding} must be a list of the form @samp{(@var{name} @var{arglist} @var{forms}@dots{})}, which defines a function exactly as if -it were a @code{defun*} form. The function @var{name} is defined +it were a @code{cl-defun} form. The function @var{name} is defined accordingly for the duration of the body of the @code{flet}; then the old function definition, or lack thereof, is restored. @@ -1723,7 +1713,7 @@ function, or a use of its name quoted by @code{quote} or @subsection Macro Bindings @noindent -These forms create local macros and ``symbol macros.'' +These forms create local macros and ``symbol macros''. @defspec cl-macrolet (bindings@dots{}) forms@dots{} This form is analogous to @code{flet}, but for macros instead of @@ -1759,7 +1749,7 @@ I.e., @code{(setq foo 4)} in the above would be equivalent to @code{(setf foo 4)}, which in turn expands to @code{(setf (car bar) 4)}. Likewise, a @code{let} or @code{let*} binding a symbol macro is -treated like a @code{letf} or @code{letf*}. This differs from true +treated like a @code{letf} or @code{cl-letf*}. This differs from true Common Lisp, where the rules of lexical scoping cause a @code{let} binding to shadow a @code{cl-symbol-macrolet} binding. In this package, only @code{lexical-let} and @code{lexical-let*} will shadow a symbol @@ -1773,8 +1763,9 @@ expansion of another macro: (cl-defmacro my-dolist ((x list) &rest body) (let ((var (gensym))) (list 'cl-loop 'for var 'on list 'do - (cl-list* 'cl-symbol-macrolet (list (list x (list 'car var))) - body)))) + (cl-list* 'cl-symbol-macrolet + (list (list x (list 'car var))) + body)))) (setq mylist '(1 2 3 4)) (my-dolist (x mylist) (cl-incf x)) @@ -1828,7 +1819,7 @@ of the form where @var{keylist} is a list of key values. If there is exactly one value, and it is not a cons cell or the symbol @code{nil} or @code{t}, then it can be used by itself as a @var{keylist} without -being enclosed in a list. All key values in the @code{case} form +being enclosed in a list. All key values in the @code{cl-case} form must be distinct. The final clauses may use @code{t} in place of a @var{keylist} to indicate a default clause that should be taken if none of the other clauses match. (The symbol @code{otherwise} @@ -1999,7 +1990,7 @@ evaluated, then each @var{var} is set to the associated @var{step} expression (as if by a @code{cl-psetq} form) and the next iteration begins. Once the @var{end-test} becomes true, the @var{result} forms are evaluated (with the @var{var}s still bound to their -values) to produce the result returned by @code{do}. +values) to produce the result returned by @code{cl-do}. The entire @code{cl-do} loop is enclosed in an implicit @code{nil} block, so that you can use @code{(cl-return)} to break out of the @@ -2007,7 +1998,7 @@ loop at any time. If there are no @var{result} forms, the loop returns @code{nil}. If a given @var{var} has no @var{step} form, it is bound to its -@var{init} value but not otherwise modified during the @code{do} +@var{init} value but not otherwise modified during the @code{cl-do} loop (unless the code explicitly modifies it); this case is just a shorthand for putting a @code{(let ((@var{var} @var{init})) @dots{})} around the loop. If @var{init} is also omitted it defaults to @@ -2099,7 +2090,7 @@ that they are either too simple and limited, such as Common Lisp's obscure, like Common Lisp's @code{do} loop. To remedy this, recent versions of Common Lisp have added a new -construct called the ``Loop Facility'' or ``@code{loop} macro,'' +construct called the ``Loop Facility'' or ``@code{loop} macro'', with an easy-to-use but very powerful and expressive syntax. @menu @@ -2161,7 +2152,7 @@ them to return a value by using an accumulation clause like @code{collect}, an end-test clause like @code{always}, or an explicit @code{return} clause to jump out of the implicit block. (Because the loop body is enclosed in an implicit block, you can -also use regular Lisp @code{return} or @code{return-from} to +also use regular Lisp @code{cl-return} or @code{cl-return-from} to break out of the loop.) @end defspec @@ -2185,7 +2176,7 @@ language. @noindent This loop iterates over all Emacs buffers, using the list -returned by @code{buffer-list}. For each buffer @code{buf}, +returned by @code{buffer-list}. For each buffer @var{buf}, it calls @code{buffer-file-name} and collects the results into a list, which is then returned from the @code{cl-loop} construct. The result is a list of the file names of all the buffers in @@ -2818,6 +2809,7 @@ Of course, @code{return} is generally used inside an @code{if} or the loop would never get to ``loop'' more than once. The clause @samp{return @var{form}} is equivalent to +@c FIXME cl-do, cl-return? @samp{do (return @var{form})} (or @code{return-from} if the loop was named). The @code{return} clause is implemented a bit more efficiently, though. @@ -3061,7 +3053,8 @@ and declare it inline all at once. @example (cl-declaim (inline foo bar)) -(cl-eval-when (compile load eval) (cl-proclaim '(inline foo bar))) +(cl-eval-when (compile load eval) + (cl-proclaim '(inline foo bar))) (defsubst foo (...) ...) ; instead of defun @end example @@ -3091,7 +3084,7 @@ The word @code{optimize} is followed by any number of lists like @code{(speed 3)} or @code{(safety 2)}. Common Lisp defines several optimization ``qualities''; this package ignores all but @code{speed} and @code{safety}. The value of a quality should be an integer from -0 to 3, with 0 meaning ``unimportant'' and 3 meaning ``very important.'' +0 to 3, with 0 meaning ``unimportant'' and 3 meaning ``very important''. The default level for both qualities is 1. In this package, with the optimizing compiler, the @@ -3125,7 +3118,7 @@ automatically be unset after the enclosing form is done.) This declaration controls what sorts of warnings are generated by the byte compiler. Again, only the optimizing compiler generates warnings. The word @code{warn} is followed by any -number of ``warning qualities,'' similar in form to optimization +number of ``warning qualities'', similar in form to optimization qualities. The currently supported warning types are @code{redefine}, @code{callargs}, @code{unresolved}, and @code{free-vars}; in the current system, a value of 0 will @@ -3227,10 +3220,6 @@ whereas if it occurs later, this simply uses @code{setcdr} to splice out the property and value cells. @end defspec -@iftex -@secno=2 -@end iftex - @node Creating Symbols @section Creating Symbols @@ -3289,10 +3278,6 @@ which were left out of Emacs Lisp. * Implementation Parameters:: @code{cl-most-positive-float}. @end menu -@iftex -@secno=1 -@end iftex - @node Predicates on Numbers @section Predicates on Numbers @@ -3326,10 +3311,6 @@ number. On systems that support floating-point, this is equivalent to @code{floatp}. On other systems, this always returns @code{nil}. @end defun -@iftex -@secno=3 -@end iftex - @node Numerical Functions @section Numerical Functions @@ -3412,10 +3393,6 @@ This function returns the same value as the second return value of @code{cl-truncate}. @end defun -@iftex -@secno=8 -@end iftex - @node Random Numbers @section Random Numbers @@ -3433,7 +3410,7 @@ The @var{state} argument should be a @code{random-state} object which holds the state of the random number generator. The function modifies this state object as a side effect. If @var{state} is omitted, it defaults to the variable -@code{*random-state*}, which contains a pre-initialized +@code{cl--random-state}, which contains a pre-initialized @code{random-state} object. @end defun @@ -3683,7 +3660,7 @@ just like @code{cl-mapcar}, but it returns a sequence of type @var{result-type} rather than a list. @var{result-type} must be one of the following symbols: @code{vector}, @code{string}, @code{list} (in which case the effect is the same as for -@code{mapcar*}), or @code{nil} (in which case the results are +@code{cl-mapcar}), or @code{nil} (in which case the results are thrown away and @code{cl-map} returns @code{nil}). @end defun @@ -3914,9 +3891,10 @@ by returning a changed copy of the sequence. @findex cl-substitute-if-not @findex cl-nsubstitute-if @findex cl-nsubstitute-if-not -The @code{cl-substitute-if}, @code{cl-substitute-if-not}, @code{cl-nsubstitute-if}, -and @code{cl-nsubstitute-if-not} functions are defined similarly. For -these, a @var{predicate} is given in place of the @var{old} argument. +The functions @code{cl-substitute-if}, @code{cl-substitute-if-not}, +@code{cl-nsubstitute-if}, and @code{cl-nsubstitute-if-not} are defined +similarly. For these, a @var{predicate} is given in place of the +@var{old} argument. @node Searching Sequences @section Searching Sequences @@ -4145,10 +4123,6 @@ specified test. The @code{:key} function, if specified, is applied to the elements of both trees. @xref{Sequences}. @end defun -@iftex -@secno=3 -@end iftex - @node Substitution of Expressions @section Substitution of Expressions @@ -4384,7 +4358,7 @@ You can create a new @code{person} by calling @code{make-person}, which takes keyword arguments @code{:name}, @code{:age}, and @code{:sex} to specify the initial values of these slots in the new object. (Omitting any of these arguments leaves the corresponding -slot ``undefined,'' according to the Common Lisp standard; in Emacs +slot ``undefined'', according to the Common Lisp standard; in Emacs Lisp, such uninitialized slots are filled with @code{nil}.) Given a @code{person}, @code{(copy-person @var{p})} makes a new @@ -4465,10 +4439,6 @@ enclosed in lists.) The following structure options are recognized. @table @code -@iftex -@itemmax=0 in -@advance@leftskip-.5@tableindent -@end iftex @item :conc-name The argument is a symbol whose print name is used as the prefix for the names of slot accessor functions. The default is the name of @@ -4508,7 +4478,8 @@ option. (cl-defstruct (person (:constructor nil) ; no default constructor - (:constructor new-person (name sex &optional (age 0))) + (:constructor new-person + (name sex &optional (age 0))) (:constructor new-hound (&key (name "Rover") (dog-years 0) &aux (age (* 7 dog-years)) @@ -4519,7 +4490,7 @@ option. The first constructor here takes its arguments positionally rather than by keyword. (In official Common Lisp terminology, constructors that work By Order of Arguments instead of by keyword are called -``BOA constructors.'' No, I'm not making this up.) For example, +``BOA constructors''. No, I'm not making this up.) For example, @code{(new-person "Jane" 'female)} generates a person whose slots are @code{"Jane"}, 0, and @code{female}, respectively. @@ -4545,7 +4516,7 @@ ever generated.) In true Common Lisp, @code{typep} is always able to recognize a structure object even if @code{:predicate} was used. In this -package, @code{typep} simply looks for a function called +package, @code{cl-typep} simply looks for a function called @code{@var{typename}-p}, so it will work for structure types only if they used the default predicate name. @@ -4778,7 +4749,7 @@ This function takes a single Lisp form as an argument and inserts a nicely formatted copy of it in the current buffer (which must be in Lisp mode so that indentation works properly). It also expands all Lisp macros which appear in the form. The easiest way to use -this function is to go to the @code{*scratch*} buffer and type, say, +this function is to go to the @file{*scratch*} buffer and type, say, @example (cl-prettyexpand '(loop for x below 10 collect x)) @@ -4998,8 +4969,8 @@ in @code{map-odd-elements} by the time the @code{(+ a x)} function is called. (This package avoids such problems in its own mapping functions -by using names like @code{cl-x} instead of @code{x} internally; -as long as you don't use the @code{cl-} prefix for your own +by using names like @code{cl--x} instead of @code{x} internally; +as long as you don't use this prefix for your own variables no collision can occur.) @xref{Lexical Bindings}, for a description of the @code{lexical-let} @@ -5044,7 +5015,7 @@ Lisp, they are totally distinct in Emacs Lisp. Common Lisp programs which refer to a symbol by the full name sometimes and the short name other times will not port cleanly to Emacs. -Emacs Lisp does have a concept of ``obarrays,'' which are +Emacs Lisp does have a concept of ``obarrays'', which are package-like collections of symbols, but this feature is not strong enough to be used as a true package mechanism. @@ -5064,10 +5035,10 @@ codes provide such features as paragraph filling, case conversion, and even loops and conditionals. While it would have been possible to implement most of Common -Lisp @code{format} in this package (under the name @code{format*}, +Lisp @code{format} in this package (under the name @code{cl-format}, of course), it was not deemed worthwhile. It would have required a huge amount of code to implement even a decent subset of -@code{format*}, yet the functionality it would provide over +@code{cl-format}, yet the functionality it would provide over Emacs Lisp's @code{format} would rarely be useful. @item diff --git a/etc/NEWS b/etc/NEWS index d891e28e7ef..b6f8cd92af1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -332,6 +332,7 @@ The difference is that it relies on the `lexical-binding' machinery (as opposed to the `lexical-let' machinery used previously) to capture definitions in closures, so such closures will only work if `lexical-binding' is in use. ++++ *** `progv' was rewritten to use the `let' machinery. A side effect is that vars without corresponding value are bound to nil rather than making them unbound. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07ce9cea1a3..1150b68fe0f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-25 Glenn Morris + + * emacs-lisp/cl-macs.el (cl-progv): Doc fix. + 2012-10-24 Stefan Monnier * minibuffer.el (minibuffer-force-complete): Use one more marker 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. "Bind SYMBOLS to VALUES dynamically in BODY. The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. Each symbol in the first list is bound to the corresponding value in the -second list (or made unbound if VALUES is shorter than SYMBOLS); then the +second list (or to nil if VALUES is shorter than SYMBOLS); then the BODY forms are executed and their result is returned. This is much like a `let' form, except that the list of symbols can be computed at run-time." (declare (indent 2) (debug (form form body))) From 4e98ad153c44f8827456e0e970ed3ab96d3493b5 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Oct 2012 21:24:21 -0400 Subject: [PATCH 029/109] NEWS copyedits --- etc/NEWS | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index b6f8cd92af1..dbf580285e8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -76,20 +76,11 @@ links between the various manuals. /usr/pkg/lib to the linker search path. You must add them yourself if you want them. ---- -** On Mac OS X, configure no longer automatically adds the Fink /sw -directories to the search path. You must add them yourself if you want them. - --- ** The standalone scripts rcs-checkin and vcdiff have been removed (from the bin and libexec directories, respectively). The former is no longer relevant, the latter is replaced by lisp (in vc-sccs.el). ---- -** The native Windows user interface is available for Cygwin. Passing ---with-w32 will configure a Cygwin emacs to use the Windows user -interface instead of the default, X11. - * Startup Changes in Emacs 24.3 @@ -205,9 +196,7 @@ The PCL-CVS commands are still available via the keyboard. --- *** New input method `vietnamese-vni'. -** NextStep/OSX port changes. ---- -*** OSX 10.4 or newer is required to build Emacs. +** Nextstep (GNUstep / Mac OS X) port changes --- *** Fullscreen and frame parameter fullscreen is supported. --- @@ -926,20 +915,32 @@ See the "Face Attributes" section of the Elisp manual. * Changes in Emacs 24.3 on non-free operating systems -+++ -** On MS Windows, you can pass --without-libxml2 to configure.bat to omit -support for libxml2, even if its presence is detected. - -** When invoked with the -nw switch to run on the Windows text-mode terminal, -Emacs now supports mouse highlight, help-echo (in the echo area), and -`mouse-autoselect-window'. +--- +** Cygwin builds can use the native MS Windows user interface. +Pass --with-w32 to configure. The default remains the X11 interface. ** Two new functions are available in Cygwin builds: `cygwin-convert-path-from-windows' and `cygwin-convert-path-to-windows'. These functions allow Lisp code to access the Cygwin file-name mapping machinery to convert between Cygwin and Windows-native file names. +** When invoked with the -nw switch to run on the Windows text-mode terminal, +Emacs now supports mouse highlight, help-echo (in the echo area), and +`mouse-autoselect-window'. + ** On MS Windows Vista and later Emacs now supports symbolic links. + ++++ +** On MS Windows, you can pass --without-libxml2 to configure.bat to omit +support for libxml2, even if its presence is detected. + +--- +** On Mac OS X, the Nextstep port requires OS X 10.4 or later. + +--- +** On Mac OS X, configure no longer automatically adds the Fink /sw +directories to the search path. You must add them yourself if you want them. + * Changes in Emacs 24.2 From 39ff2cf3c6cd38baf66c8c7c7ffc5b1f11a52528 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Oct 2012 21:49:54 -0400 Subject: [PATCH 030/109] * doc/misc/cl.texi (Declarations): Fix typos. --- doc/misc/ChangeLog | 1 + doc/misc/cl.texi | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index efc4de8646b..ec46ab5eb05 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -12,6 +12,7 @@ (Dynamic Bindings): Update for changed progv behavior. (Loop Examples, Efficiency Concerns): Markup fixes. (Structures): Remove TeX margin change. + (Declarations): Fix typos. 2012-10-24 Glenn Morris diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index d3cc8bb76eb..9200958a1b5 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -3088,12 +3088,11 @@ and @code{safety}. The value of a quality should be an integer from The default level for both qualities is 1. In this package, with the optimizing compiler, the -@c FIXME does not exist? -@code{speed} quality is tied to the @code{byte-compile-optimize} +@code{speed} quality is tied to the @code{byte-optimize} flag, which is set to @code{nil} for @code{(speed 0)} and to @code{t} for higher settings; and the @code{safety} quality is tied to the @code{byte-compile-delete-errors} flag, which is -set to @code{t} for @code{(safety 3)} and to @code{nil} for all +set to @code{nil} for @code{(safety 3)} and to @code{t} for all lower settings. (The latter flag controls whether the compiler is allowed to optimize out code whose only side-effect could be to signal an error, e.g., rewriting @code{(progn foo bar)} to From 69deda53a85df68656b62acdd45662101fef58b7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 24 Oct 2012 21:35:39 -0700 Subject: [PATCH 031/109] Don't assume process IDs fit in int. * emacs.c (shut_down_emacs) [!DOS_NT]: * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]: * term.c (dissociate_if_controlling_tty) [!DOS_NT]: Use pid_t, not int, to store process IDs, as 'int' is not wide enough on a few platforms (e.g., AIX and IRIX). --- src/ChangeLog | 9 +++++++++ src/emacs.c | 4 ++-- src/sysdep.c | 2 +- src/term.c | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e59a286110d..835c550b426 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-10-25 Paul Eggert + + Don't assume process IDs fit in int. + * emacs.c (shut_down_emacs) [!DOS_NT]: + * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]: + * term.c (dissociate_if_controlling_tty) [!DOS_NT]: + Use pid_t, not int, to store process IDs, as 'int' + is not wide enough on a few platforms (e.g., AIX and IRIX). + 2012-10-23 Kenichi Handa The following change is to make face-font-rescale-alist work 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) /* If we are controlling the terminal, reset terminal modes. */ #ifndef DOS_NT { - int pgrp = EMACS_GETPGRP (0); - int tpgrp = tcgetpgrp (0); + pid_t pgrp = EMACS_GETPGRP (0); + pid_t tpgrp = tcgetpgrp (0); if ((tpgrp != -1) && tpgrp == pgrp) { reset_all_sys_modes (); 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) #if defined (SIGTSTP) && !defined (MSDOS) { - int pgrp = EMACS_GETPGRP (0); + pid_t pgrp = EMACS_GETPGRP (0); EMACS_KILLPG (pgrp, SIGTSTP); } 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 dissociate_if_controlling_tty (int fd) { #ifndef DOS_NT - int pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ + pid_t pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ if (pgid != -1) { #if defined (USG5) From cee6efdef3af910f952968a28094e89bde13faed Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 25 Oct 2012 06:17:47 -0400 Subject: [PATCH 032/109] Auto-commit of loaddefs files. --- lisp/emacs-lisp/cl-loaddefs.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index d05fbc42060..684ea42b157 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "885919e79dbcd11081cfb2e039b470c7") +;;;;;; "cl-macs" "cl-macs.el" "366e9efa4e3e7a81b2253e503611b23a") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ @@ -485,7 +485,7 @@ before assigning any symbols SYM to the corresponding values. Bind SYMBOLS to VALUES dynamically in BODY. The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. Each symbol in the first list is bound to the corresponding value in the -second list (or made unbound if VALUES is shorter than SYMBOLS); then the +second list (or to nil if VALUES is shorter than SYMBOLS); then the BODY forms are executed and their result is returned. This is much like a `let' form, except that the list of symbols can be computed at run-time. From f956e59dbb34ee4b87603fc92db1ebaf58776d18 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 25 Oct 2012 14:08:44 +0200 Subject: [PATCH 033/109] * tramp.texi (Frequently Asked Questions): Mention `tramp-completion-reread-directory-timeout' for performance improvement. --- doc/misc/ChangeLog | 6 ++++++ doc/misc/tramp.texi | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index ec46ab5eb05..fc44828e8bf 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,9 @@ +2012-10-25 Michael Albinus + + * tramp.texi (Frequently Asked Questions): Mention + `tramp-completion-reread-directory-timeout' for performance + improvement. + 2012-10-25 Glenn Morris * cl.texi: Don't mess with the TeX section number counter. 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 @code{tramp-persistency-file-name}. Keep this file. If you are confident that files on remote hosts are not changed out of @value{emacsname}' control, set @code{remote-file-name-inhibit-cache} -to @code{nil}. +to @code{nil}. Set also @code{tramp-completion-reread-directory-timeout} +to @code{nil}, @ref{Filename completion}. Disable version control. If you access remote files which are not under version control, a lot of check operations can be avoided by From a7723be6dd55da926ade554df4f4fab86c094835 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 25 Oct 2012 08:38:09 -0400 Subject: [PATCH 034/109] * lisp/emacs-lisp/package.el (package-installed-p): Warn if not ready. Fixes: debbugs:12721 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/package.el | 1 + 2 files changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1150b68fe0f..bb19e10b9ae 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-25 Stefan Monnier + + * emacs-lisp/package.el (package-installed-p): Warn if not ready + (bug#12721). + 2012-10-25 Glenn Morris * emacs-lisp/cl-macs.el (cl-progv): Doc fix. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 28d166271fb..303642b5bec 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -728,6 +728,7 @@ It will move point to somewhere in the headers." (defun package-installed-p (package &optional min-version) "Return true if PACKAGE, of MIN-VERSION or newer, is installed. MIN-VERSION should be a version list." + (unless package--initialized (error "package.el is not yet initialized!")) (let ((pkg-desc (assq package package-alist))) (if pkg-desc (version-list-<= min-version From fb5b947504a34cd19aee4cddf308927cc1a90100 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 25 Oct 2012 08:41:23 -0400 Subject: [PATCH 035/109] * lisp/net/ldap.el (ldap-search-internal): The official ldif format starts with a "version: 1" header. Fixes: debbugs:12724 --- lisp/ChangeLog | 3 +++ lisp/net/ldap.el | 1 + 2 files changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bb19e10b9ae..0c78ea4038e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-25 Stefan Monnier + * net/ldap.el (ldap-search-internal): The official ldif format starts + with a "version: 1" header (bug#12724). + * emacs-lisp/package.el (package-installed-p): Warn if not ready (bug#12721). 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." ;; Skip error message when retrieving attribute list (if (looking-at "Size limit exceeded") (forward-line 1)) + (if (looking-at "version:") (forward-line 1)) ;bug#12724. (while (progn (skip-chars-forward " \t\n") (not (eobp))) From 414a8595f0b5b95bd89547a59b57a6effb757491 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 25 Oct 2012 08:56:13 -0400 Subject: [PATCH 036/109] * lisp/minibuffer.el (minibuffer-force-complete): Fix thinko. --- lisp/ChangeLog | 2 ++ lisp/minibuffer.el | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0c78ea4038e..71b3e3029b3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-25 Stefan Monnier + * minibuffer.el (minibuffer-force-complete): Fix thinko. + * net/ldap.el (ldap-search-internal): The official ldif format starts with a "version: 1" header (bug#12724). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 4267fe4db4f..4421e325b91 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1124,10 +1124,10 @@ Repeated uses step through the possible completions." (completion--message (if all "No more completions" "No completions"))) ((not (consp (cdr all))) - (let ((mod (equal (car all) (buffer-substring-no-properties base end)))) - (if mod (completion--replace base end (car all))) + (let ((done (equal (car all) (buffer-substring-no-properties base end)))) + (unless done (completion--replace base end (car all))) (completion--done (buffer-substring-no-properties start (point)) - 'finished (unless mod "Sole completion")))) + 'finished (when done "Sole completion")))) (t (completion--replace base end (car all)) (completion--done (buffer-substring-no-properties start (point)) 'sole) From aaabfc8b2744aabe00b9fc97eaca59940b5afdeb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 25 Oct 2012 09:00:52 -0400 Subject: [PATCH 037/109] * lisp/dired.el (dired-get-marked-files): Allow ! on . and ... Fixes: debbugs:12725 --- lisp/ChangeLog | 2 ++ lisp/dired.el | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 71b3e3029b3..ea75d3774a1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-25 Stefan Monnier + * dired.el (dired-get-marked-files): Allow ! on . and .. (bug#12725). + * minibuffer.el (minibuffer-force-complete): Fix thinko. * net/ldap.el (ldap-search-internal): The official ldif format starts diff --git a/lisp/dired.el b/lisp/dired.el index 9094ce08f0a..fb2f7281130 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -620,7 +620,7 @@ Don't use that together with FILTER." (let* ((all-of-them (save-excursion (dired-map-over-marks - (dired-get-filename localp) + (dired-get-filename localp 'no-error-if-not-filep) arg nil distinguish-one-marked))) result) (if (not filter) From 3f2a848dbeb297cdadfc9dd3cff71bab24679b92 Mon Sep 17 00:00:00 2001 From: David Engster Date: Thu, 25 Oct 2012 22:13:16 +0200 Subject: [PATCH 038/109] Merge CEDET upstream. * emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression): Removed. This feature is already integrated in imenu. * emacs-lisp/eieio-opt.el: Remove require for `button' since it is always loaded. Require `speedbar' unconditionally. * semantic/analyze.el (semantic-analyze-dereference-alias): New function to dereference aliases. (semantic-analyze-current-context-default): Use it. * semantic/grammar.el (semantic-grammar-create-package): * srecode/compile.el (srecode-compile-templates): Throw a proper error if semantic-mode is not enabled (bug#9968). Compiler warning fixes: * semantic.el (semantic-elapsed-time): Make it a defsubst. * srecode/dictionary.el (srecode-adebug-dictionary): Remove require for `semantic'. * srecode/map.el: * srecode/insert.el: Declare functions from `data-debug'. * semantic/grammar.el: Require `help-fns'. Declare functions from `eldoc', which is required in function body. * srecode/java.el: * semantic/texi.el: * semantic/grammar-wy.el: * semantic/db-file.el: * semantic/db-el.el: * semantic/chart.el: Fix requires. * ede/locate.el: Remove useless requires. Declare functions instead and require in functions when needed. --- lisp/ChangeLog | 8 ++++++++ lisp/cedet/ChangeLog | 33 ++++++++++++++++++++++++++++++ lisp/cedet/ede/locate.el | 30 ++++++++++++++++++++------- lisp/cedet/semantic.el | 2 +- lisp/cedet/semantic/analyze.el | 34 ++++++++++++++++++++++++++----- lisp/cedet/semantic/chart.el | 5 +---- lisp/cedet/semantic/db-el.el | 7 +------ lisp/cedet/semantic/db-file.el | 5 +---- lisp/cedet/semantic/grammar-wy.el | 5 ++--- lisp/cedet/semantic/grammar.el | 12 +++++++++++ lisp/cedet/semantic/texi.el | 10 ++------- lisp/cedet/srecode/compile.el | 2 ++ lisp/cedet/srecode/dictionary.el | 1 - lisp/cedet/srecode/insert.el | 4 ++++ lisp/cedet/srecode/java.el | 5 +---- lisp/cedet/srecode/map.el | 3 ++- lisp/emacs-lisp/eieio-opt.el | 8 ++------ lisp/emacs-lisp/eieio.el | 23 --------------------- 18 files changed, 124 insertions(+), 73 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea75d3774a1..188cd9ce941 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-10-25 David Engster + + * emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression): + Removed. This feature is already integrated in imenu. + + * emacs-lisp/eieio-opt.el: Remove require for `button' since it is + always loaded. Require `speedbar' unconditionally. + 2012-10-25 Stefan Monnier * dired.el (dired-get-marked-files): Allow ! on . and .. (bug#12725). 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 @@ +2012-10-25 David Engster + + * semantic/analyze.el (semantic-analyze-dereference-alias): New + function to dereference aliases. + (semantic-analyze-current-context-default): Use it. + + * semantic/grammar.el (semantic-grammar-create-package): + * srecode/compile.el (srecode-compile-templates): Throw a proper + error if semantic-mode is not enabled (bug#9968). + + Compiler warning fixes: + + * semantic.el (semantic-elapsed-time): Make it a defsubst. + + * srecode/dictionary.el (srecode-adebug-dictionary): Remove + require for `semantic'. + + * srecode/map.el: + * srecode/insert.el: Declare functions from `data-debug'. + + * semantic/grammar.el: Require `help-fns'. Declare functions from + `eldoc', which is required in function body. + + * srecode/java.el: + * semantic/texi.el: + * semantic/grammar-wy.el: + * semantic/db-file.el: + * semantic/db-el.el: + * semantic/chart.el: Fix requires. + + * ede/locate.el: Remove useless requires. Declare functions + instead and require in functions when needed. + 2012-10-23 Stefan Monnier * 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 @@ ;; when it is available. (require 'ede) -(eval-when-compile (require 'data-debug) - (require 'eieio-datadebug) - (require 'cedet-global) - (require 'cedet-idutils) - (require 'cedet-cscope)) - -(require 'locate) +(eval-when-compile (require 'locate)) ;;; Code: (defcustom ede-locate-setup-options @@ -214,6 +208,12 @@ that created this EDE locate object." ;;; GLOBAL ;; + +(declare-function cedet-gnu-global-version-check "cedet-global") +(declare-function cedet-gnu-global-root "cedet-global") +(declare-function cedet-gnu-global-expand-filename "cedet-global") +(declare-function cedet-gnu-global-create/update-database "cedet-global") + (defclass ede-locate-global (ede-locate-base) () "EDE Locator using GNU Global. @@ -260,6 +260,12 @@ that created this EDE locate object." ;;; IDUTILS ;; + +(declare-function cedet-idutils-version-check "cedet-idutils") +(declare-function cedet-idutils-support-for-directory "cedet-idutils") +(declare-function cedet-idutils-expand-filename "cedet-idutils") +(declare-function cedet-idutils-create/update-database "cedet-idutils") + (defclass ede-locate-idutils (ede-locate-base) () "EDE Locator using IDUtils. @@ -303,6 +309,12 @@ that created this EDE locate object." ;;; CSCOPE ;; + +(declare-function cedet-cscope-version-check "cedet-scope") +(declare-function cedet-cscope-support-for-directory "cedet-scope") +(declare-function cedet-cscope-expand-filename "cedet-cscope") +(declare-function cedet-cscope-create/update-database "cedet-cscope") + (defclass ede-locate-cscope (ede-locate-base) () "EDE Locator using Cscope. @@ -315,6 +327,7 @@ file name searching variable `cedet-cscope-file-command'.") ;; Get ourselves initialized. (call-next-method) ;; Do the checks. + (require 'cedet-cscope) (cedet-cscope-version-check) (when (not (cedet-cscope-support-for-directory (oref loc root))) (error "Cannot use Cscope in %s" @@ -324,6 +337,7 @@ file name searching variable `cedet-cscope-file-command'.") (defmethod ede-locate-ok-in-project :static ((loc ede-locate-cscope) root) "Is it ok to use this project type under ROOT." + (require 'cedet-cscope) (cedet-cscope-version-check) (when (cedet-cscope-support-for-directory root) root)) @@ -334,11 +348,13 @@ file name searching variable `cedet-cscope-file-command'.") Searches are done under the current root of the EDE project that created this EDE locate object." (let ((default-directory (oref loc root))) + (require 'cedet-cscope) (cedet-cscope-expand-filename filesubstring))) (defmethod ede-locate-create/update-root-database :STATIC ((loc ede-locate-cscope) root) "Create or update the GNU Global database for the current project." + (require 'cedet-cscope) (cedet-cscope-create/update-database root)) (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." "When non-nil, activate the interactive parsing debugger. Do not set this yourself. Call `semantic-debug'.") -(defun semantic-elapsed-time (start end) +(defsubst semantic-elapsed-time (start end) "Copied from elp.el. Was `elp-elapsed-time'. Arguments START and END bound the time being calculated." (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'." (function nil) (fntag nil) arg fntagend argtag - assign asstag + assign asstag newseq ) ;; Pattern for Analysis: @@ -601,16 +601,26 @@ Returns an object based on symbol `semantic-analyze-context'." (if debug-on-error (catch 'unfindable - ;; If debug on error is on, allow debugging in this fcn. (setq prefix (semantic-analyze-find-tag-sequence - prefix scope 'prefixtypes 'unfindable))) + prefix scope 'prefixtypes 'unfindable)) + ;; If there's an alias, dereference it and analyze + ;; sequence again. + (when (setq newseq + (semantic-analyze-dereference-alias prefix)) + (setq prefix (semantic-analyze-find-tag-sequence + newseq scope 'prefixtypes 'unfindable)))) ;; Debug on error is off. Capture errors and move on (condition-case err ;; NOTE: This line is duplicated in ;; semantic-analyzer-debug-global-symbol ;; You will need to update both places. - (setq prefix (semantic-analyze-find-tag-sequence - prefix scope 'prefixtypes)) + (progn + (setq prefix (semantic-analyze-find-tag-sequence + prefix scope 'prefixtypes)) + (when (setq newseq + (semantic-analyze-dereference-alias prefix)) + (setq prefix (semantic-analyze-find-tag-sequence + newseq scope 'prefixtypes)))) (error (semantic-analyze-push-error err)))) ) @@ -679,6 +689,20 @@ Returns an object based on symbol `semantic-analyze-context'." ;; Return our context. context-return)) +(defun semantic-analyze-dereference-alias (taglist) + "Dereference first tag in TAGLIST if it is an alias. +Returns a sequence of names which can then be fed again into +`semantic-analyze-find-tag-sequence'. +Returns nil if no alias was found." + (when (eq (semantic-tag-get-attribute (car taglist) :kind) 'alias) + (let ((tagname + (semantic-analyze-split-name + (semantic-tag-name + (car (semantic-tag-get-attribute (car taglist) :members)))))) + (append (if (listp tagname) + tagname + (list tagname)) + (cdr taglist))))) (defun semantic-adebug-analyze (&optional ctxt) "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 @@ ;; the output of the semantic parser. ;; -(require 'semantic) (require 'chart) (require 'semantic/db) -(require 'semantic/tag) - -(eval-when-compile (require 'semantic/find)) +(require 'semantic/find) ;;; Code: 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 @@ ;; (require 'semantic/db) - -(eval-when-compile - ;; For generic function searching. - (require 'eieio) - (require 'eieio-opt) - (require 'eieio-base)) +(require 'eieio-opt) (declare-function semantic-elisp-desymbolify "semantic/bovine/el") (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 @@ ;; A set of semanticdb classes for persistently saving caches on disk. ;; -(require 'semantic) (require 'semantic/db) (require 'cedet-files) - -(eval-when-compile - (require 'data-debug)) +(require 'data-debug) (defvar semanticdb-file-version semantic-version "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 @@ ;;; Code: -(require 'semantic/lex) -(eval-when-compile (require 'semantic/bovine)) - +(require 'semantic) + ;;; Prologue ;; (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 @@ (require 'semantic/format) (require 'semantic/grammar-wy) (require 'semantic/idle) +(require 'help-fns) (declare-function semantic-momentary-highlight-tag "semantic/decorate") (declare-function semantic-analyze-context "semantic/analyze") @@ -47,6 +48,9 @@ (require 'semantic/find) (require 'semantic/db)) +(declare-function semantic-grammar-wy--install-parser + "semantic/gram-wy-fallback") + ;;;; ;;;; Set up lexer @@ -825,6 +829,8 @@ Does nothing if the Lisp code seems up to date. If optional argument FORCE is non-nil, unconditionally re-generate the Lisp code." (interactive "P") + (unless (semantic-active-p) + (error "You have to activate semantic-mode to create a package.")) (setq force (or force current-prefix-arg)) (semantic-fetch-tags) (let* ( @@ -1636,6 +1642,12 @@ Select the buffer containing the tag's definition, and move point there." ) "Association of syntax elements, and the corresponding help.") +(declare-function eldoc-function-argstring "eldoc") +(declare-function eldoc-docstring-format-sym-doc "eldoc") +(declare-function eldoc-last-data-store "eldoc") +(declare-function eldoc-get-fnsym-args-string "eldoc") +(declare-function eldoc-get-var-docstring "eldoc") + (defun semantic-grammar-eldoc-get-macro-docstring (macro expander) "Return a one-line docstring for the given grammar MACRO. 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 @@ ;; parser plug-in is the function `semantic-texi-parse-region' that ;; overrides `semantic-parse-region'. -(require 'semantic) +(require 'semantic/db-find) (require 'semantic/format) +(require 'semantic/ctxt) (require 'texinfo) -(eval-when-compile - (require 'semantic/db) - (require 'semantic/db-find) - (require 'semantic/ctxt) - (require 'semantic/find) - (require 'semantic/doc)) - (defvar ede-minor-mode) (declare-function lookup-words "ispell") (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." (defun srecode-compile-templates () "Compile a semantic recode template file into a mode-local variable." (interactive) + (unless (semantic-active-p) + (error "You have to activate semantic-mode to compile SRecode templates.")) (require 'srecode/insert) (message "Compiling template %s..." (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." "Run data-debug on this mode's dictionary." (interactive) (require 'eieio-datadebug) - (require 'semantic) (require 'srecode/find) (let* ((modesym major-mode) (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." ;; area. Return value is not important. )) +(declare-function data-debug-new-buffer "data-debug") +(declare-function data-debug-insert-stuff-list "data-debug") +(declare-function data-debug-insert-thing dictionary "data-debug") + (defun srecode-insert-show-error-report (dictionary format &rest args) "Display an error report based on DICTIONARY, FORMAT and ARGS. 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 @@ ;;; Code: (require 'srecode/dictionary) -(require 'semantic/tag) - -(eval-when-compile - (require 'semantic/find)) +(require 'semantic/find) ;;;###autoload (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." ;; Eventually, I want to return many maps to search through. (list srecode-current-map))) -(eval-when-compile (require 'data-debug)) +(declare-function data-debug-new-buffer "data-debug") +(declare-function data-debug-insert-stuff-list "data-debug") (defun srecode-adebug-maps () "Run ADEBUG on the output of `srecode-get-maps'." 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 @@ ;; (require 'eieio) -(require 'button) -(require 'help-mode) (require 'find-func) +(require 'speedbar) +(require 'help-mode) ;;; Code: ;;;###autoload @@ -710,10 +710,6 @@ Arguments UNUSED are not used." ;;; SPEEDBAR SUPPORT ;; -(eval-when-compile - (condition-case nil - (require 'speedbar) - (error (message "Error loading speedbar... ignored")))) (defvar eieio-class-speedbar-key-map nil "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." ) ) -;;; Interfacing with imenu in emacs lisp mode -;; (Only if the expression is defined) -;; -(if (eval-when-compile (boundp 'lisp-imenu-generic-expression)) -(progn - -(defun eieio-update-lisp-imenu-expression () - "Examine `lisp-imenu-generic-expression' and modify it to find `defmethod'." - (let ((exp lisp-imenu-generic-expression)) - (while exp - ;; it's of the form '( ( title expr indx ) ... ) - (let* ((subcar (cdr (car exp))) - (substr (car subcar))) - (if (and (not (string-match "|method\\\\" substr)) - (string-match "|advice\\\\" substr)) - (setcar subcar - (replace-match "|advice\\|method\\" t t substr 0)))) - (setq exp (cdr exp))))) - -(eieio-update-lisp-imenu-expression) - -)) - ;;; Autoloading some external symbols, and hooking into the help system ;; From 25ca458727b561c39a9f524179443ab91617bf3a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 26 Oct 2012 00:32:40 -0700 Subject: [PATCH 039/109] Misc fixes for make uninstall * Makefile.in (uninstall): Don't abort if some directories are missing. Apply transformation rules to manual pages, desktop and icon files. No more emacs22 icons to uninstall. --- ChangeLog | 6 ++++++ Makefile.in | 33 ++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14a4c4cdfc0..62a3eef7a69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-10-26 Glenn Morris + + * Makefile.in (uninstall): Don't abort if some directories are missing. + Apply transformation rules to manual pages, desktop and icon files. + No more emacs22 icons to uninstall. + 2012-10-24 Glenn Morris * Makefile.in (install-etc, install-man): diff --git a/Makefile.in b/Makefile.in index 20d680e06ab..d7eec829495 100644 --- a/Makefile.in +++ b/Makefile.in @@ -685,21 +685,28 @@ uninstall: -rm -rf $(DESTDIR)${libexecdir}/emacs/${version} thisdir=`/bin/pwd`; \ (info_misc=`cd doc/misc; ${MAKE} echo-info | sed '/ing directory/d'`; \ - cd $(DESTDIR)${infodir} && \ - for elt in ${INFO_NONMISC} $${info_misc}; do \ - (cd $${thisdir}; \ - $(INSTALL_INFO) --remove --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \ - if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ - ext=.gz; else ext=; fi; \ - rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \ - done;) + if cd $(DESTDIR)${infodir}; then \ + for elt in ${INFO_NONMISC} $${info_misc}; do \ + (cd $${thisdir}; \ + $(INSTALL_INFO) --remove --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \ + if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ + ext=.gz; else ext=; fi; \ + rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \ + done; \ + fi) (if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ ext=.gz; else ext=; fi; \ - cd ${mansrcdir} && for page in *.1; do \ - rm -f $(DESTDIR)${man1dir}/$$page$$ext; done ) - (cd $(DESTDIR)${bindir} && rm -f $(EMACSFULL) $(EMACS)) - (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 ) - -rm -f $(DESTDIR)${desktopdir}/emacs.desktop + if cd ${mansrcdir}; then \ + for page in *.1; do \ + rm -f $(DESTDIR)${man1dir}/`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1$$ext; done; \ + fi) + (cd $(DESTDIR)${bindir} && rm -f $(EMACSFULL) $(EMACS) || true) + (if cd $(DESTDIR)${icondir}; then \ + rm -f hicolor/*x*/apps/`echo emacs | sed '$(TRANSFORM)'`.png \ + hicolor/scalable/apps/`echo emacs | sed '$(TRANSFORM)'`.svg \ + hicolor/scalable/mimetypes/`echo emacs-document | sed '$(TRANSFORM)'`.svg; \ + fi) + -rm -f $(DESTDIR)${desktopdir}/`echo emacs | sed '$(TRANSFORM)'`.desktop for file in snake-scores tetris-scores; do \ file=$(DESTDIR)${gamedir}/$${file}; \ [ -s $${file} ] || rm -f $$file; \ From eeced60b6ca4be63abca61cab5967ee28537a8af Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 26 Oct 2012 00:39:47 -0700 Subject: [PATCH 040/109] Program name transformations should not be applied to $EXEEXT. * Makefile.in (EMACS, EMACSFULL): * lib-src/Makefile.in (install, uninstall): Transformations should not be applied to $EXEEXT. --- ChangeLog | 3 +++ Makefile.in | 4 ++-- lib-src/ChangeLog | 5 +++++ lib-src/Makefile.in | 10 ++++++---- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62a3eef7a69..c9498dbfeb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2012-10-26 Glenn Morris + * Makefile.in (EMACS, EMACSFULL): Transformations should not be + applied to $EXEEXT. + * Makefile.in (uninstall): Don't abort if some directories are missing. Apply transformation rules to manual pages, desktop and icon files. No more emacs22 icons to uninstall. diff --git a/Makefile.in b/Makefile.in index d7eec829495..29aed2b0be8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -259,8 +259,8 @@ GZIP_INFO = @GZIP_INFO@ TRANSFORM = @program_transform_name@ # What emacs should be called when installed. -EMACS = `echo emacs${EXEEXT} | sed '$(TRANSFORM)'` -EMACSFULL = `echo emacs-${version}${EXEEXT} | sed '$(TRANSFORM)'` +EMACS = `echo emacs | sed '$(TRANSFORM)'`${EXEEXT} +EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT} # Subdirectories to make recursively. SUBDIR = lib lib-src src lisp leim diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index c88b467ee29..6b23c040b17 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2012-10-26 Glenn Morris + + * Makefile.in (install, uninstall): Transformations should not be + applied to $EXEEXT. + 2012-10-23 Eli Zaretskii * makefile.w32-in (lisp2): Add cp51932.el and eucjp-ms.el, to diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index c5acca28856..dcd7123bb26 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -244,17 +244,19 @@ install: $(DESTDIR)${archlibdir} @echo "Installing utilities for users to run." umask 022; ${MKDIR_P} $(DESTDIR)${bindir} for file in ${INSTALLABLES} ; do \ - $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ + $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ done for file in ${INSTALLABLE_SCRIPTS} ; do \ $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ done uninstall: - (cd $(DESTDIR)${bindir}; \ - for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \ + for file in ${INSTALLABLES}; do \ + rm -f $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ + done + for file in ${INSTALLABLE_SCRIPTS}; do \ rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ - done) + done if [ -d $(DESTDIR)${archlibdir} ]; then \ (cd $(DESTDIR)${archlibdir} && \ rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \ From b75897ba631b8dbbb337bd378689b4d35f25b853 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 26 Oct 2012 00:40:51 -0700 Subject: [PATCH 041/109] * Makefile.in (uninstall): No INSTALLABLES live in archlibdir. --- lib-src/ChangeLog | 2 ++ lib-src/Makefile.in | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 6b23c040b17..03cddc6a035 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,7 @@ 2012-10-26 Glenn Morris + * Makefile.in (uninstall): No INSTALLABLES live in archlibdir. + * Makefile.in (install, uninstall): Transformations should not be applied to $EXEEXT. diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index dcd7123bb26..d271bb3a4fa 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -258,8 +258,7 @@ uninstall: rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ done if [ -d $(DESTDIR)${archlibdir} ]; then \ - (cd $(DESTDIR)${archlibdir} && \ - rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \ + (cd $(DESTDIR)${archlibdir} && rm -f ${UTILITIES} ${SCRIPTS}) \ fi mostlyclean: From 8c7727c3354291d0798b2eb031f42a32c618c391 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 26 Oct 2012 11:11:24 +0200 Subject: [PATCH 042/109] Fix bug#12731 in mouse-drag-line. * mouse.el (mouse-drag-line): Move last form into preceding when clause (Bug#12731). * help.el (resize-temp-buffer-window): Fix doc-string. --- lisp/ChangeLog | 7 +++++++ lisp/help.el | 7 ++++--- lisp/mouse.el | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 188cd9ce941..75fbaa13b92 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-10-26 Martin Rudalics + + * mouse.el (mouse-drag-line): Move last form into preceding when + clause (Bug#12731). + + * help.el (resize-temp-buffer-window): Fix doc-string. + 2012-10-25 David Engster * emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression): 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. Do not make WINDOW higher than `temp-buffer-max-height' nor smaller than `window-min-height'. Do nothing if WINDOW is not -vertically combined or some of its contents are scrolled out of -view." +vertically combined, some of its contents are scrolled out of +view, or WINDOW was not created by `display-buffer'." (setq window (window-normalize-window window t)) (let ((buffer-name (buffer-name (window-buffer window)))) (let ((height (if (functionp temp-buffer-max-height) @@ -1022,11 +1022,12 @@ view." temp-buffer-max-height)) (quit-cadr (cadr (window-parameter window 'quit-restore)))) (cond - ;; Don't resize WINDOW if it showed another buffer before. + ;; Resize WINDOW iff it was split off by `display-buffer'. ((and (eq quit-cadr 'window) (pos-visible-in-window-p (point-min) window) (window-combined-p window)) (fit-window-to-buffer window height)) + ;; Resize FRAME iff it was created by `display-buffer'. ((and fit-frame-to-buffer (eq quit-cadr 'frame) (eq window (frame-root-window window))) 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'." ;; If mouse-2 has never been done by the user, it doesn't have ;; the necessary property to be interpreted correctly. (put 'mouse-2 'event-kind 'mouse-click) - (setcar event 'mouse-2)) - (push event unread-command-events))) + (setcar event 'mouse-2) + (push event unread-command-events)))) (defun mouse-drag-mode-line (start-event) "Change the height of a window by dragging on the mode line." From ccc83f50a4ca55842bcf955b9f8156c17aa43864 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 26 Oct 2012 11:46:46 +0200 Subject: [PATCH 043/109] Avoid hourglass mouse pointer when a tooltip for menu item is shown. src/w32fns.c (w32_wnd_proc) : Don't enable tracking of mouse movement events if the menu bar is active. This avoids producing a busy "hour-glass" cursor by Windows if the mouse pointer is positioned over a tooltip shown for some menu item. --- src/ChangeLog | 7 +++++++ src/w32fns.c | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 835c550b426..bf519556334 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-10-26 Eli Zaretskii + + * w32fns.c (w32_wnd_proc) : Don't enable tracking of + mouse movement events if the menu bar is active. This avoids + producing a busy "hour-glass" cursor by Windows if the mouse + pointer is positioned over a tooltip shown for some menu item. + 2012-10-25 Paul Eggert Don't assume process IDs fit in int. 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) versions, there is no way of telling when the mouse leaves the frame, so we just have to put up with help-echo and mouse highlighting remaining while the frame is not active. */ - if (track_mouse_event_fn && !track_mouse_window) + if (track_mouse_event_fn && !track_mouse_window + /* If the menu bar is active, turning on tracking of mouse + movement events might send these events to the tooltip + frame, if the user happens to move the mouse pointer over + the tooltip. But since we don't process events for + tooltip frames, this causes Windows to present a + hourglass cursor, which is ugly and unexpected. So don't + enable tracking mouse events in this case; they will be + restarted when the menu pops down. (Confusingly, the + menubar_active member of f->output_data.w32, tested + above, is only set when a menu was popped up _not_ from + the frame's menu bar, but via x-popup-menu.) */ + && !menubar_in_use) { TRACKMOUSEEVENT tme; tme.cbSize = sizeof (tme); From bdebdb64b35d6a0a28e04335f4e8e46949206ad3 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 26 Oct 2012 16:42:05 +0200 Subject: [PATCH 044/109] Merge upstream Org (from commit acbbe2) --- doc/misc/ChangeLog | 6 + doc/misc/org.texi | 43 ++-- etc/ChangeLog | 5 + etc/refcards/orgcard.pdf | Bin 118438 -> 118492 bytes etc/refcards/orgcard.tex | 4 +- lisp/org/ChangeLog | 297 ++++++++++++++++++++++++ lisp/org/ob-ditaa.el | 1 + lisp/org/ob-haskell.el | 2 + lisp/org/ob-io.el | 2 +- lisp/org/ob-keys.el | 4 +- lisp/org/ob-lob.el | 5 +- lisp/org/ob-picolisp.el | 1 + lisp/org/ob-ref.el | 1 + lisp/org/ob-scala.el | 14 +- lisp/org/ob-sql.el | 3 +- lisp/org/ob-sqlite.el | 3 +- lisp/org/ob-tangle.el | 5 +- lisp/org/ob.el | 37 ++- lisp/org/org-agenda.el | 275 ++++++++++++++++++++++- lisp/org/org-archive.el | 7 + lisp/org/org-ascii.el | 5 + lisp/org/org-attach.el | 4 + lisp/org/org-bbdb.el | 6 +- lisp/org/org-beamer.el | 3 +- lisp/org/org-capture.el | 8 +- lisp/org/org-clock.el | 75 ++++++- lisp/org/org-colview.el | 4 + lisp/org/org-compat.el | 2 +- lisp/org/org-datetree.el | 4 + lisp/org/org-docbook.el | 4 + lisp/org/org-element.el | 252 +++++++++++++-------- lisp/org/org-exp.el | 8 +- lisp/org/org-faces.el | 8 +- lisp/org/org-feed.el | 4 + lisp/org/org-footnote.el | 4 + lisp/org/org-freemind.el | 6 +- lisp/org/org-html.el | 6 +- lisp/org/org-icalendar.el | 4 + lisp/org/org-id.el | 7 +- lisp/org/org-indent.el | 4 + lisp/org/org-install.el | 44 +--- lisp/org/org-irc.el | 4 + lisp/org/org-latex.el | 36 +-- lisp/org/org-lparse.el | 22 +- lisp/org/org-mobile.el | 5 +- lisp/org/org-odt.el | 6 +- lisp/org/org-plot.el | 4 + lisp/org/org-publish.el | 5 +- lisp/org/org-remember.el | 4 + lisp/org/org-src.el | 70 +++--- lisp/org/org-table.el | 69 +++++- lisp/org/org-taskjuggler.el | 4 + lisp/org/org-timer.el | 6 +- lisp/org/org-version.el | 4 +- lisp/org/org-xoxo.el | 4 + lisp/org/org.el | 434 +++++++++++------------------------- 56 files changed, 1253 insertions(+), 601 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index fc44828e8bf..a0cfd675f0a 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,9 @@ +2012-10-26 Bastien Guerry + + * org.texi (Installation): Update the link to Org's ELPA. Also + don't mention org-install.el anymore as the replacement file + org-loaddefs.el is now loaded by org.el. + 2012-10-25 Michael Albinus * tramp.texi (Frequently Asked Questions): Mention diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 89c99018460..cdaf1174a26 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -857,7 +857,7 @@ Theory Ltd.} @b{Important:} @i{If you the version of Org that comes with Emacs or as a XEmacs package, please skip this section and go directly to @ref{Activation}. If you downloaded Org as an ELPA package, please read the instructions on the -@uref{http://orgmode.org/elpa/, Org ELPA page}. To see what version of Org +@uref{http://orgmode.org/elpa.html, Org ELPA page}. To see what version of Org (if any) is part of your Emacs distribution, type @kbd{M-x org-version} (if your Emacs distribution does not come with Org, this function will not be defined).} @@ -947,7 +947,7 @@ description on Worg}. Installing Info files is system dependent, because of differences in the @file{install-info} program. The Info documentation is installed together with the rest of Org mode. If you don't install Org mode, it is possible to -install the Info documentation separately (you need to have +install the Info documentation seperately (you need to have install-info@footnote{The output from install-info (if any) is system dependent. In particular Debian and its derivatives use two different versions of install-info and you may see the message: @@ -964,13 +964,6 @@ on your system). make install-info @end example -Then add the following line to @file{.emacs}. It is needed so that -Emacs can autoload functions that are located in files not immediately loaded -when Org mode starts. -@lisp -(require 'org-install) -@end lisp - Do not forget to activate Org as described in the following section. @page @@ -1092,9 +1085,6 @@ shown below. ;; add latest org-mode to load path (add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp")) (add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp" t)) - -;; activate org -(require 'org-install) @end example 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 extensions}). See also @ref{Conflicts}, for a discussion of the interaction with @code{shift-selection-mode}. See also the variable @code{org-treat-S-cursor-todo-selection-as-state-change}. -@orgcmd{C-c / t,org-show-todo-key} +@orgcmd{C-c / t,org-show-todo-tree} @cindex sparse tree, for TODO @vindex org-todo-keywords 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 @item C-c ' Edit the source code example at point in its native mode. This works by switching to a temporary buffer with the source code. You need to exit by -pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*} -or @samp{#} will get a comma prepended, to keep them from being interpreted -by Org as outline nodes or special comments. These commas will be stripped -for editing with @kbd{C-c '}, and also for export.}. The edited version will -then replace the old version in the Org buffer. Fixed-width regions -(where each line starts with a colon followed by a space) will be edited -using @code{artist-mode}@footnote{You may select a different-mode with the -variable @code{org-edit-fixed-width-region-mode}.} to allow creating ASCII -drawings easily. Using this command in an empty line will create a new -fixed-width region. +pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*}, +@samp{,*}, @samp{#+} and @samp{,#+} will get a comma prepended, to keep them +from being interpreted by Org as outline nodes or special syntax. These +commas will be stripped for editing with @kbd{C-c '}, and also for export.}. +The edited version will then replace the old version in the Org buffer. +Fixed-width regions (where each line starts with a colon followed by a space) +will be edited using @code{artist-mode}@footnote{You may select +a different-mode with the variable @code{org-edit-fixed-width-region-mode}.} +to allow creating ASCII drawings easily. Using this command in an empty line +will create a new fixed-width region. @kindex C-c l @item C-c l 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. # DIR=`pwd` FILES="" -ORGINSTALL="~/src/org/lisp/org-install.el" # wrap each argument in the code required to call tangle on it for i in $@@; do FILES="$FILES \"$i\"" done -emacs -Q --batch -l $ORGINSTALL \ +emacs -Q --batch \ --eval "(progn (add-to-list 'load-path (expand-file-name \"~/src/org/lisp/\")) (add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\" t)) @@ -16704,7 +16693,7 @@ on @file{org-element.el} and @file{org-export.el} has been outstanding, and opened the doors for many new ideas and features. @item Jambunathan K -Jambunathan contributed the ODT exporter, definitely a killer feature of +Jambunathan contributed the ODT exporter, definitly a killer feature of Org mode. He also contributed the new HTML exporter, which is another core feature of Org. Here too, I knew I could rely on him to fix bugs in these areas and to patiently explain the users what was the problems and solutions. @@ -16712,7 +16701,7 @@ areas and to patiently explain the users what was the problems and solutions. @item Achim Gratz Achim rewrote the building process of Org, turning some @emph{ad hoc} tools into a flexible and conceptually clean process. He patiently coped with the -many hiccups that such a change can create for users. +many hicups that such a change can create for users. @item Nick Dokos The Org mode mailing list would not be such a nice place without Nick, who diff --git a/etc/ChangeLog b/etc/ChangeLog index 3ebe18b407f..60d4a7aa271 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2012-10-26 Nicolas Goaziou + + * refcards/orgcard.tex: Fix keybindings about + `org-show-todo-tree'. + 2012-10-23 Paul Eggert Fix outdated timestamp documentation in Elisp manual (bug#12706). diff --git a/etc/refcards/orgcard.pdf b/etc/refcards/orgcard.pdf index 2f0044184438d5a0050adc8e8794fb1aced0b6c6..720f08d9ded7f3796ebfccdbef09ad0ed24355a6 100644 GIT binary patch delta 9273 zcmZ2Bm;KIM_6aJC2Gjp(FltWpv#MuQX!!ef_x;=3D=I%8sgku2K5lMnU!pGF?fGDa z@%5Q3i5XUo7CSxE?0xP}^?saNm{jr38Tvre66Se<;Xxgp6^>AH%!FVA&zW%Z=@zlE-s&eE4$_gQMHsbAT|8!RpO7C3ad|#6DnfRwA zOXYWNW^&9nd-J4z*V9S1d!-MRWtsTMJUOTkruXXVss_P43DqTA?yc$Skr$HsC0TdO z?~={ASuHQwP84=V6-~Rk;m$iIStlKr9nSH~9&048c-*8ZxbNwtj#GY;rQXNKW(fWk(9#p=p4I8BV0%m9 zIJro^Q;g& zFmF3U2j`9pU;buGtuxqsLGqGN+ok#2jxD_z!CBv(Uu5ec`+BE*568T&P1gCVk9Z4l zM_j3s7MbYgaU}BJW;M=7YXqFy+=601`r6cYm@b!^tTD}P(Uf&2R-%kby}SD)enl1U z3(uSuX<+Aao`2qlm4(TBP4i5S?`!s4{KxAfyGz8$BXjG#g?=m({@L!fU$|2GPx;GM zJB>HCTI@yjA=7f#+&i1cl$l}WIpb*aPZ1$r-l)O}mcPRz&6^{a@(B4|T*fQNGc9!A zah>u2y{gONs)cIjN?cFOV3J&4n$#JwZ?9<8OZ(_j_H@V3oI7;*=WVV(?Q}uIIdrXv zcw29wjfk(M{a1s)BSCY|xCW)n4(IxoQ028kxlf+&|CabW_2oJ?T9G#lD9A2GS-L(F4Ps_wjSK5l=7;Ww^*z~CE@uL(up`!<{ZkVd^ zsq2|m>~oEKs%j4E<(hjXLwJ}^_}vb%)C+EC-BOv5dGdJas@ z_he_Wr$K9zd*>dQZ5KH2_Oml{S@IHo<*BUN@8Tuc*|}rJu7`D&wz`H%UsLDbU}pJ$ zz%ItCB)Z=!O=Xq1(vhWGohIIOh}n|qZG9tVR_*1I+{?u>h8KV5Uy!`Qf?5~Uda}H=LQd!IWVUuH zEsWA(SJ1mA>DE*+&xGe=!OibiKD5kz`{-ps1VdJ3=_#8;)fsOZ=W?D5oOSVL@UqE! ztW~%8Z%|^s+8_|q@VJzD`i+k|$&89qRdtRyQ-B3Syl5 zAW7?3{oHa5L-XhNd@e9OUwFGNKIqH1|G*Lls|g=Je{J;IP!lV1GXD5-t+eADo_x%Q{5g7F zhdSQ7yLk#bA7lNFr^aH(6wTU{lD0g%DF5XB{3?+d#?MdO`Zw?7W}VQDKXyO+F0gb# z!qT_vO2vI{d71F+of`Q`Ag27x{I5KAwJ-lAi27v&UAQt$LoQlcs5zNYYn@;ryNj`L z2p^-W=VKcQomWxSt5&|roEm2$`Q#Sw%R`%7W{alh$B2n8PiQq}suwPN}AFSo~e-n`Rl_r0_1RL-8`YG-_` zCw#Qm<`*gwoHa$Xzj_we_tmzZaw$v+v%dFe)&F~@Z`0k>;_J?>m?!Z`Piaozk$Kna znI`gg9h+w2|E0;`e1<^Igoy{(zGli-Z%K~4E;CIh$wo`;Qx&hyp%Sy2 znKQUVEERX`xT?2$oy*%!2i?5WZdXj~WDR%^RmIJ**mnB0mq}OO!m^giirUFd^+ktM z1A6Ce%)MU{_1wENxht>h+>Lu@N@6&RnRBh}JU1_l+jwMeONmeUyOrBKzfLpQ;2|BGi{JId<$re2h{WqW4mc5N9R$&Ac0pSxb> zSKsN*?kr-6mu&iW(==O3)HOo=#jV2Q)5_|9W%~E9{wdnlxi4K(bI#0td#5jB{`aPa z`R@9wT#u^`%-*|9cJtF&uVUTKPI})_rItO>=Z5L3hJC9e0*eGMvN{$uJY^H~udKiUu(1n$y-PdOGeAapBdT73_u2K8$?R)k<;nRHm_w({|%l%{5I(@ELec{X+eV(0~ zmDMj7&E*i9T6M2nWVyk0iI*u4Wv*F@G2V&bs^&2077$Fk2oaE)BU+W)Zp z-(t%>h0<6){zJPrk`Jba`r*1y1KHo zS@S2G&zU>7(R258Z>9@rlka9;nYJQENKR;{%o2gcr$0M>+QJn3aM$E;A@d_*D#omx zLYMj-l;55zwzcC`NIbZtMKf8K>C1B-@BNNQrx4%^8oFOR4RTx6AY_ox5u~ORAyZqB7w# zQd7f~UTSxzoh-i5FLBTR#?ALL_AdU~rM_NoUQGqlyQA|ggzb4cH(5_MSY)RjS8xCG zp?dYC3HSHSyRpo?U(Ni>xvwl@vmUO@Df;&$-#_k9+Ol(2VvTPt?e=iosZ-zeYC_we zymsAOyGy}4&OPIva6Wz2*UD{=#g0x|b;Dw*_SyQYuXl<5)xMAyvdnXNr_RCYXNx+& zhR^z!`*(G^>qPyz&L{KlwKeLsi09Nz^tV3qw0_bxzYh{Eo8KNfut?fPOETL0=XBlT zUBy2l);kr>&XYbTB9ndW`|=Y~>yz|XyZb9M9Nm2G#rbVaN=HLvIWwa#vv1_|uU;9Z z=oWsVrM>AF{Wv9>c#y`7h}K<#4a;mOO_ zJ~ZDcH*JSbS=iJF)s3;61&__S&fl~)G-+B-e>SVsJK0ZvldXn+UZzl6C zt?s6uySG$fORs#8z^>oZUrc_{v{Wi8x4rqw$@oy^-Q}AvdY5KRH{`ux85XbBez&@4 zr}PBp>q?*3nV)bA`_fpXvHD5f0TsdOqR!iS=4}TzedD>6dxR-L?YZ)$H;cDdrm+{B zNal3-?(tH(rf77v)$c{)b&Yzt$4|NM>cqdiuUk>5_+Ii>&^J@9ZLc`iiABY{U3ekR ztn*pDZQk1MWry05cm5X_Ny@M}`^Hr7$hz<=*ZVFqURASwI)m+leb1erT(gT3qaR+I zv^A$crM9&wy8O~7p(~|xKK@!PcG_XG%Y<8I-hnSI7e&UOU%ooIZ1(X!+49BPmFm@d z<8@yDJmdZ3Wt#H7zzZ)k!+6g!zrA~WG4m^vaJy*7q_aGlzc;Wrc^L(+Z*RYr(YZRg zqrz68*2Vaq%U@fQ81bi~_iYqxrE5Hw{GKZ~;ns8$=ECK3Rr~Mqy*(kkQzSO<#na2F z$I4r@y}l&qi^yjudB>Q}T=C}AH~pLI&VRG2mvQ5{>10)vzkA;9q}>Gux9$G~6m_+9 z&Hk`S=aivQS#84c#|Q7pU&&h|`i^Pp>2J*p(T!JU2xLj$(T@trHJ|k0Hm~RV)?1xA zvyJvIUgQ|AW^q$-Ntngw1kHVR8#aDEkSFn@j#p=fN4v%;R^Pw-C#U!Q_2K@#>4lYl z$Nb5EAKk6LRB1AA>AiXL{#MLrl&~+T6j4m!+WsisA#3lAe{bGR^t>kHYQ*W!qTsA$ zEEWFGplg-msl~~cyJLlf%%*SD(Oz)BrM5F|>*VSe2OdgCJ!tsI*Y`tAuq@~yKd*Mw zLCKcer-J*87$ZuyeSfm5`DpUfm3JfW%6S;q7GD!CJ8@OzUj4)E^Y2E#owp!9Y4WaB zX^U6i7y9$mV%i_I7hCrmZQ_k9ey{iXzEod8Tht-9e4~Bu-b|5M^-Gp>bC%g`9of9K z);)y_C9QNL4_@QjDKUXrRLAnJC}YvYrmg7=(>xBeiLTQ~`?T1n=|=CP+gfEBRrgyS zxh=A)j9gTt?O)mHV*kytUbpX?pn~m!qYGbt;%^F75ld;*PwWs6T(Hjk`R{ip99y-& zRXSNP=A2p|7{26z_|a>JUxxiKp4GiS%QGtMP0gVV%RQ3}^d38=Y`i+@^fP;@Dl?-^ zYr;ChdBRsjm8Lq@9dOW=t7O=F@!*teX3yWn5V!hAYb12=<9;E9%!Nx~oTRYsw%ll_G>7%jmA z9rb5pUQeFwCiMT^ey8xAt2{#4j!4(+47qu$^wFHRcQ=>zYpI8}Cxj_=J3QQ|{r9`M ztv*}hnGH8%?oJooaM;J+-~ao1`NOlnaz9?1ea^>yyX^T{Yu~4>TlssMWwEWld2IeR zzqI&g=1;?Z2k4mGo~6$5pXJ*h;a$$Er;^Kdcb#HcS3l?HdGGQ}NwI&1;``Us8{NBQ z9MAuEDd$}FzIQjz`55Qk<Oym-x) ziiJD3b?U#e^OVY6&ARJt>z7upRE;#|CodwT+l6eGxCWnO;p2I=tEyr7v9`Z!_U^CS zZDzOk_rv2~FKk%zbxLEPt=${1$!u{mK408;lk57?ve|}a_iJ|T`d3n0@0!n-T6iE_ z!O^tfpGo6=_o_gRjeiwg`%663a&v06wOBI!TIkblw6^iY9M}i_*@mDOlP5L-+XC(#x}s z{ucjm=iqstJKv28(p6{O-TUKrxA_9Yr>M~c}E^rrNy(NC&Df^+1-j};KnjI}a zT6=2NovBCX{mouD^YgMJza0zrIZryA_WNhqQWfjeDPbp0a6Ig9`B0RTIB&^)yX^lv zOxNYr|NA;I^YhH^+dt*D6g%B5uh^}BO`o|WdfL+63AR3SFV1}?np3*0RnC&xaI4E% z{gt!g&z(Hd*W>p<|AN>18)3F7g8R>0S|vC81pAs@cCqWHE{R*AeSDViq6RY`r3-9E z4AoZX~^5DKu?nYgc4JHPO8vbq}m;cMY_^nw#dD6*Uc}sJrEOEZJUHMG! zjidlmo+W~ef$F+pNtw>e=NWu{9rr9doBiXeWrmll54=@eG;P~E9o0><>`a%f-aYN~ z>^)H#efekQ%URPeocF$b(&5Mimc}QJG1Af|`^~@RvoZ3`wmN3M?|^yth1u@6*E@){ z&(2tvw$Svdkxcs6Eidc&Ts>#ytFO6|pEZlsHFDS4^PGZWMyFpeZTh&nkZG1Nw}}_$ z0twi_#Tl=%LA`Z+fV_RkO>*f|&RkhsBNzImpS*^ym7TI*p zuzE1%z&Y!5mHP!1j@o;6ygD7;b0RvyXy4tSfK3 z3Xcc($~TRs%zz{1*woxOMIv^i;A4|hI~4D||Cn;_$R>W3nW-lNzrHz@!(f-3 zsPL-$f$5Zj`zLrm)=Qb>r5cxnOQ-I-yYk_tU79zKbkEt`s;k{|Tko~XV^!OQ@N&RAiNEht#GUsCL|nOJVc@?eMWW1Q*2~*Qfp2s6`*ADJh{$F=Bd)oz zO8)NTgA#fZmpn7{4aj^F7+F^E?Zk@v<$u<^pAxq8edCD|jxw!-$M{d3YB5ysnpEuI z#~xnaaOIWOYp&E4`<_Ux;^!#-y-IP*7u9KcTzf9r9&#wEm*^Ku{JqisO8N|K!4J(* z{z>^e{x|*2zqfaj*5#=dQ_Q{o4QCW{+8{Q+U);Hl}6CpF3usVyWg6nQ`%UT2YN}uc4CA zRWH-8^?`R+6(1>CbM;*(-QM;DfiCp0*UJ!-=}juTl73(mu&ux ztF_)0tL*is$JJ-}m)A32Jo04ovX6`Y&5?;NpS$7cN|i@B4m>;L1wPr_{am}XW5Szf zU)AfBtWC6fYaJg8S~pL&IKsJY%Uh9MF&mxl=6&rH3jfu!!N!(jo~4f3?FSZap`~(; zy+#FE-fgDhB1yHjnG<79$n%_f_IQ3Dz2`HD(tXF3 z)FwwL|9NZ39_qDvOL6_3rIM3VyL1AK%s$CIE?hG6*cFAPqK86O?>g{k7 zS<4rBBqr&XKS#*s`lfBhCuZ3ljZgV-;M0=nhg8EHjjxv(ZcEaMYP_HBtRnP(r~0Hv zI?SsA*b61go>dgcot6^cJELUtl8J}we;dCKx4dp(v@|65;_F8VM*`&*`!sHQ?!oV& zB6cj$)8WRc?NOWcvgBM=&f?vECCA^sb&`wWf*arSQf{fZ=WD5cWci!=#py!nmWPH9 zj!#)UW#LpE!S254{#`exFK)Cxw(@#R@5T#vcHC}?HBUZJ{zi&*dfSelS>j6ds^$+P zm6p|eg)aZ;n#tPcvS52^s?zNzw>YCje1EFEsta_ETOMJM9xisa?D}>s-NJQ2yE2#7 zu8!bqu>H#TZpw{Q(=^M%c8I;~dYYp7=iHAt)he;%=&40%JW-)-Hh1hkB~(Ps-O=%% zCt2fRd##~c95)b923$3GlqJx*Oe<)Pt2{-*}DR*qMV4}Gtfc<6d=vZc(nZC^gyyc6d5 z_n~GIv(SOX0iky{C|Et$lGB^>ziZ-)6rufc5i1bQS_WWyU5%66^HYETZu{A7x`?@JZEZm z-qdw1=Tjw(SDwc<6>ZmUu1ftT9OSH&60>N=P0zT+pJzPdJYCc?;X{2~=7ZdWjJ!+{iYVE5oszXUH1*J=Besr$72n;OB0M*GZL?gs z>4QhT+_w+eXXX9g{QLYiMbY!p3Y)Kj+?5G)j&InWI?LmK(evFIllz+6SNlo)WA`%I z{rmQoTUMPua`PRI?{a?k{>#zz)<^1Q`NZir9OCr|%c(pnrT8??hrPv#RXt7ilAK1p zyzyh(DZIxfhufWfyk=!pnVwc;&bNiV8!xPScxu77ty1^RMNUhs7ybLk`ppi$9p?{y zo9`OEC`NDN($0n&?yZv(7Q3I+w$8buW!QIS&%4P@oX@wqm6rc@KeSzP@$rCQjx!E@MNcV^=;0ZBAL~>dtLy)NQ*)3c8;c>-cj`(jql=L?Xq(_7@KZsCcM%6>@!)< zuhBk&A*|P%_l3k?#{uJBSqY#tRe*OntFA>gS2tQ%lWLU2h5f zSlhL%N7Ud_{obf^%Tun-of~1at9w??l%4hOIMSD_IBzvExUj1u(XI5!_Z2g|SM?gp zM@{LCTl47t#++Xgrt5bt+8@U2Z*=>Zw(b6~T+i()4{v^4AM&JJYq!wKqUGIuU4Iv@ zbe+~aU3$UiSjE#pM<_S<8&$Iguv-@r`@U;Uv8-ia$0LNX?fP|%{mnm7q5G$(z_vi!qOEc zn^wq`1sv=9@-<7li8Fg;OsLZA_(^iRL%52*)xau5-px3I2EV%dbbGbSEnpR`5i zZO$Y0phq`esAkZ&jwYWYgmMFxG36JHvYB+g{Q-RmV^`k9D5@*$_Ye6Z59WD3!*|u79j` z{n-lDTdLhPE7jarWlYK}c6{#;@U4>LWz&kodaD9TA5PKwyp6%M=eqpr$n~3lB*ifa z9oYZ&qux}b_VfNTUamV4l-BI_`+uOWxu0^ZNd9;3cGsHe?F^1f476WX?wX_XYRB_k zLAS)})zz&t$`ltyHoZ=c>TlD!Evy)#5?@qbU+=Fpm4DHX|4t_!eV3Jf_}sGZmCFa= zGUqEjpFUXx}7jgwI)ELyvpRq!+lKs%(h9G*gr%Jmk-$udmI6xq2$@-w|$X@@-@NF34{j zy4=>FxnB0j*)~lT#yU~1|CbFH-S=ZlEsXN+$D>pe{*>dkPN-cudl|#)s#=)tW8l{ z1U~ZDoITej{-y88lL)QwTU|j$FDAGeUi$qquEd68cK7zPjY3Bg4lLQyr&9gm^;6$F z5+%oKB&U8<> zVdkkGs=)d7+C0HjY8D>lDq&hEU)N3t0aAjM; zAEN`6{^u_p=sxl~_3n?5?O)YjSno>iI?Q+f%kS@{>Kjr`-F`0%Jm2+Aw_l_{w`+Zv zxx8IWeN3>cXu{w7w$BcDXBT}@U_Yvo+5V==KlKFD0e6XCK7QLjRqg8jHa+n2QM(PL zs(fb2v%j)E(Oz89S+_cCPtkTujtvU+K~nM7x_@otUkmJ575FdfxaGvRhU?_EDp>@s ztnpg)KeD6v)w$`7^^siqEk_NH9A6anLqb9%GP7^{ob{et1lIk~U;C$db;rMuvt`{{ zU0o06W!V0!H=mQgz^X;d;e_QSzjrV4b$6xb?be%pV#4*94f&j*p9<9jAN#ykFVefe zf862ESAX5L7hfj%z&hu`_4j#pd~Y;36tkvfpZ(wFm*Tcz zs;)S*!J~{L3o1_hH=n-mv}jdD=8-C=XPdJ4*!MJVo#H)XnzPqh9 z$N&1_3(u|oY}k;yL1&Wc&36wZXI?w=ZG+xXYhUwbzXqn);VZMf`KHNH zYA-VX;HGKIT2)Ved7dx6(0`)NB7QsZa?^~N?h4HrAs5#i*mPj^Dw)f(_n%JQ^{wLb z3$?V?XD{XK<^DR@)n9eLzs#xczCb+R7Ed-Qxru4|nbuBXB^?{rbvEk0?El%ges)#( zlp|LvKi`g>wUqtWCG}hJh5RhWJg=i7nC|e|&R)T^u-W{?y~EDaU+AgHYqhjYb+frA_V9+rnBrO|9MtWdC)ZrK*wi;HLU~?<+ogWW=JM-Da)-8Fk8TZH8#; z>t8PR2i|Y%DcW?;LE46afoK1d-Hc)hiaV594zeCoE}fa@A;a_T@gs**1rMaIu)It< zUfu7wb=sS&&XE~4%TK+YqSm6{=%2VtxZ;8~Pn}XctHLFZfBk~4Qp#1nkuA54mbS=$ zJb$R8v+VxI877Y2Z`c=nYSfXC7M;Clm+`F*QwFiinXmph=l*A%xxasTbA-zF2o=T) z^K=ajjLZy8O^r;pxy}TOJ<5e)n5o z>=!$ir5k>_d`&3tJN4j4@2Q8IdSA^}y<>cE^95FUK_33Y(`(N$%5xbSm~*MBy863u F0RWGh%2EIT delta 9245 zcmcaJmwnk>_6aIXhKAD*x-e=?^s}mesIXyw?f2^6V*2{?BGxmfKl-ukdHcI3Nrs#< z#m}rJEAaTLbEu1-eA51McTwgZT|b`lbJb@2>E83Qdd~sXbIEm8U8h+3{=DojOR%2i z{m)X}KDH)z?>9B$V!O?<6_qZ0cW)jkuqihCe&h7RM%Tbe%bDw|Y9HMU{^XY)HP7O* zR(znr@a=hz3{`?xVC z)j*x&Ob1Wu=7aa7wyV26m>4M}wfyIz7jtJNn-rcFcg&tt@af20|Ln4bS$eO9KJT8c&bG5Tdq=(V&SpzvtqRwx=0|5{ zyCpS=>&LxYWO&2B=fsyoKlPOQ)O1uu|7wvjk;%5`s)sKFuL#Vu2=%?_RT z(b>t_{_y!5p0kcePBys9V5t}AeQuM~wA--@oI6@M%3qxRBAd!n8e^b(XnTxMV5Es< z_yOLlTa;4mCDl@N5~lvuI;!Cza%whfj5znIJ)~%tu7l+3Y7Y~thltt^eT&l@zs#XuZDjYwR&zid1@(xuuRe)owZqg zD~`QRRQ~!sf35z#+W)-b_dFfy>&&?ymjAmm=jWqx`yKXQySBgHmG+=~@59Piv%-{Im>N96u=2_4;FmG8{akJpJ*;JtzQO!4TH1aoPvpg*=Gj|kuoy)IiZ6S0rQOKA zVe8fF7Z$~IiyYhh&9O!ELiMi2^^089g<{rpOGR_G)i3sW9{u?2>g(dyes9*_zw3fY z@b2Wdy^N+zH$ICo7&3~_+E?#;STs${$~o##K>e@F*LIjlYbSp6UB|vM+4g(0;KAU) zvgf%|D?F1JyKm(;D_!E~v^ZUVO~rAJsMCoH9;>wXbw20c_$(w@=;$SnDVL_YEmv|_ zQg~g^IX?T`cdfHV+{fBq{5&XZXPUQW`?20%U)i$+UTNl{~p)gFZ0*#YTmryCrivU_VYLQ zrz&PlS-2{Ui}&y`3%RakbLLmg&`4V8_e@E1(^+lSY6DxA$lUlbfpZ z#-sX-wsoeKq}s<2!x?H7jk9`gAKVeKK5$-7gPJIFX62r}-|Dqj>1V!R2~M1Vlh-R*wr-GzURhoXNX+G6;ySICC zrH2T6_~EccC$wj+E}6TyV)_h*xp$U+Nei&$QLxSpe!9blQS8#Q#-*zA*H=n?s*gG8 zFwt^)?wnuEm+QAK6_3{6{75ME_Qrja(mqv)=@!l_kXjchH0MRLlgyRm$a7Yr^Ap=U&iv+kd8_aF!Xqy4_d90S z{D0eZWYTy2j@^+-ViO#?+|ujvW!9YjxV^NVDLAY>`B>zEWWmDgR;!C;pB>pdEn@aE zPY%oC<)Ug`Em<2)8g@jaOK?7_ykv0XaO(Zw!@_0Tx|bhLWL)v|s^;gGsR^6d%hXid zGu_htXZn45H|2ue!7iQ`-L|GGbD67e zc=sd>hx>rh+-&=U(&YWsvNA3phh`SklN!8G6?BICGL`SQ2jW*=jN zH_gI&WR7^g>f>Siu4S&3Fz*mCPJDW;V8ZE3`FkgA+R0t}PWbJV zn-%@OGiH`4JgyIuQ+c9fqNy$S-9+?Vc=aTk6D$Wz-b;r5`*SwFLX4GjcAuEj9fK#a zE*6VBY}fy1QIZ$w)y7@W5~Nzb?y)G$nSOn0hKQ{5TaM2k zeyOq6KW#g`K*~1x_P&=}&P^9OE^=37?#8_{U+xfk#&)Z$W>T8--lWcI&X+UZ-3iW} z{7QGK>a5rhyAZ}Zbpfvw;xgJkZ}`01j@|#B*e+|9fBk7u;^HbB|A(3g+*=lUcU^%& z%7Udg4NJA}hV0&+qjrk1CY2*9^ZJ_15Rt^W3$l;PM&GJ`x!l%J?8E7sYQN^CE-6U+ z^(}4|-;d3oc}w<(Y4^Nl%>Op4?98<6RppYV-uska&0OPZlz4pw)30?&t|whx#92-< z?mMb-Dq(-AYwG^-1TDLsl5Eew?FF}^q>FLR9*kZd}D{y#k@tF|5iN>mJgLV6uNur`t$SnJr!OR z-svvmi8CxYai=za9oN~_(Od4N%t+_d7y9=mbE4&)y-(k&mU~3LpKo7kSNkeUbk_6e z*0i+R#1pp|{U)Q{>r9`2*OE2VY;&wP%`UHUY+lLE$i?3u_WRRYKe2-UH$P{8 zO54ykfBxK=&z?WwO;1lxxb*JpB!(?FQ_7{bs%lMdX?M|M*F5s#Q_TdMwGQDs-aVOm zgm)wBNgu~WEnk!`c$e8fUK=ohp87RdQNQrO517g1$pt#)`1e zyQ^;GnZJDe{l08}pYr5tQ4{CxT&222;U^Sc&N|aD<%E-lys^;qlA8~I=&~ngE`O)$ z80pip;x5Z(x2ID*ew|tr`AO!Ra@%*|vTxRD?=$v3I=Q-AU4C9e^+xq`NBEr=y*a1S zv*LVb{dNDkA1CLjJh^vW`1Y4)7oW8KE3$2DO{>tFJ;(m%?a9+OY+Sjy&o!aCk6)i@ z`~A*!R!bDWzumC(ta}yL^_w+}pMLsmwL4#SXHi6u=~Ux z)#TS||2L)jmGjBJ4%NuJoO^g?Q}Wp#|3o4mhrUVu`XZBMLB%!6zc<4imdseCteBhq zOTp}6rv6o}BQLmS<=qc;H{YSU?Bra0>a}LG&f?aU$0M}$Z1pMb=2Z6G%2RvOcSGW2Mdj7r&TX%Ed%ZYT|NV4U zs(+E%&3Vs^-IxD9b91*y%eIfsTu$Zxg=&RjH-tE^ep@iX>gVdLl<#?FRV)488ZBeA zKK|12L7{8u@5T+E5;wrx{td%M1EK5RmSvGXZAoyG~1 ze6GBHxX?7}(JKk1IDQxTi#_In_58foT`P~8^Lw0Uix+)aSIn~Ho9bDIJDKSxleart ze{#`t4Hv2USu*pZ?87c0+Z)_RkI%Xx6z;30wR_WF?`^L)@2%%+7j)h>q3_=9bqZ&X=kemMNWHcIN$xj0;ma{mM92ik`EH=vvR8^TuX_G~2#-W^T1hid{vH!T;Ys znVD>V`OrR{UFU=!Jx|$RQNO)Jt~Y(<_T}mJa%l?3_+#W;Ic6SO`$K#}l>RpR-PI|R zOx-8?91>f8^lnRQmpyFL0fUvf-Fo1b^shON$eY)>3mz5U8v8)B9uyp?QF721&4s@*m7&J<69 z-wS_i>yqudXTEU9#1(#V(^lL$6&$B@vA?!HpnGvGiwA#3VaBdM%?YBNtdS4AB_6qo ztayF)=RWJAfQPFV9pszCVD>ccim2v}#W$)f?sC<;6@LuZ^*r4**I(kBi6_soRGSW+ zZBa!x|F}D!cXOL|mFr{IL$1)(>vT@=OJp2X=3iiLHRIB)XLshF)?Iw}NMe2HUmf#X z@9SB%t*uv+ZL^=hS~X+GS+lCcywjH7|G0M{=YIZ&#&<&Z2X9##P;&aC@q(7a`${|i zJNl(<_%CGj?4gCg{MM$!^0MdOzqTkpv*7OkwSPQfOU+~b|2_F$b0+C<8vFZub6wIu z6uf`1?^*!>y#v9Ax!l0J85vwm2) z_`1{|+e#l+%}d;Q@2J+kA4WSh%`Wr*e0pW0y5Yk112b!s%9kia9?_p(pD1|vX3eM9 zXXf5q=F5NWY5wZ{v-9V2-;elV%q_+LV&&U-AKl|0#QDtl^zS@nt-U?hUrulC&6aJM zzFpqgL23olE^p@fSEl~u>$1cJw~fTsoqjQoZQaAO&D|?)&HpqA@7uL=mm|~t(3Ehc z)2D+x#;!3OL0CYJ_<@q68~8KR5Ng$T40}o zSG(0Nucuk;i5dEHY9~H%4Ps1nFa3MQ`gObA$2ng=bJg?5$L){&x9sSlrZ+_oE-*j7 zW~rsTO5kN^-TV*k@49M^|7Y47+RXO5YLoqay{%#Of@-RU!EQg4mG?+IdcXO~rROit zZ+~|6?0&l<)tZNwp4afto2}1NuQ%^^(s#q#+j0-jEuJ{z@np}iLsCy)Jr3M3;nL|Z zpLxE1&NP@F*@7Sg- z_w!$o)%Uk2ADfBu{3=a58!TYB=z+vm;p+>hop{gl_jX*$p?1HqcI zpuy^7FG=41lBo;JZaj+Ly}{`q(>arRKU zx0LEP78KlJ{kvT4aG9BE`P4|2*||&87rtuZw>i%e{bP&M{HW|QoX1w zTI=t&hJuhc23RvEI&?TYbjOY~Cy4SsSaw?|lwn zaaQZPVxwlLc}7R4OYEB5i?8fYnmXI}XPx!B&K>x2!ka5heezqba;7^-9A7>`#`-$L z)n8t(yOu1mdj9lfIY)B!C6Qalcn(GLRH<4!Eqsz^&$Dj@>&>^Tg|CQuGc)uLqx0YPIR$A&+fBr*($0SaXBVQ&yuxOKw zc+NO)p=!zh(~gI_^1_7t1m$ZbLOJ_wvUqyG|50C?85~(%`uEqXzq|Xd%ltE(ViguK z?Q%uQ{`u4GW8?q+iE}x2%=<-ARF?03;|rA@8^(k+0j2?WhmBn%u*qWg65g zXRuPL)Ne=M*4d^PnWnGfcy8J&lDJJ$_^kD-!YMzw6g-!ms#w}*y^>bPun*4I<){b?%F;9?1Uq&i;hJc%(=IP4`88e!q zBMa74b_%?HS>s%z_T|3zZ2Jt)WvdeWT!Mb>y!1G)r|SdL6OEFUmzsUFj$imI*EO>z zsrSnc_a#ZQHrnS+o^skqiCc*O>z>6Gb9{7*b7owMI}mW1t0>)i&y#Jl=N|Xm>F-?s zPUP`?fi=(So3oMU%9`N@X^-=<6#GhWrC7o%>_WZCbbbMSMqf|zIhyO~SQq%&$= ziHk{-WQ;NR7Pe4eZ-=Sz;TsSCcK-hzn#r8%(Rpu4_|JPihjf%yvgPVeR0{AobGCU} z!-tvqThgY6EA<3j%T8SRb5c%vWjj!*n*ix_AcQ3+gks!m#H!KTR7w9fJ(BJ8x zS!*0AASbUsPjst3n^Sq?QOmDUD-7l4Sij#^(N}W!jNJW=xgs$ZhqB?*Akx3a=Q22%h?^aRPo$ZFALq}_g}V7 z=J_(9l}N#;CA!lVFa5Co8NdIr^DNpc)_SoRSFP1@m&+5cEU;PYAEUwd zSHkO8V*HxV3a7H1J*U?6T-yHm(XPqYmu;wG6PwnIF>5nt5&G?SV-1&3QtHtf@^P|g_Cb>`g z|4;RL8k#W?Mpc`(NF@IVl$L*C*8LANjGf;pYt#ZG&Qxlz(yB+LKpcUXRCex$)b*fmetwiOpuu})PjWsc5JoBl8`?1O^9I-zMP?>IRR?lw<8w7Ri$(^YTd&&PlTv^}`Pyt`cqgFWC7k z{J%ta?D7ekkA$BDY(4SUEB?AJ}G6=IMlG@r`we^hC%P17C2~>6eQhJddv88 z#;o@X3k;-eKYNNTExoz1IPqZeW`5ru*41_1!f&%J_v8tjp0VEa?;q<|JHG8Wf9czN zm*_)2x|{2dx;SiWeC4^}V)GMGU9-F`635-*Nr67mg$+= z54N9qt#s*t$M-7B`Ayf$we7U>iSZU6m8lZjl$Ie^dRJiA*FUhsI>3l`I-a|NO zMrOoUYYpe!AFZ~E9_-k8Wt~>wS$*&Rx!SCjnng0vvsAjd{R8ap^G#mucgEqlt!LD{ zvTZM9RSR>C0tKO|@^Z@Mk*z+-=n|_K@@5x)ZI|o-N#( zU2O85%|z^HjBj7i#U+=XHQj4m@aD9@CAPrdxe=2-ooNexm;3PC=Y_wLZC{rP#h>AF zVES?+r~bnw&Eg+_dM4(5HhE~4vElFhFGY_fUOMf$t1C0@W2_((%fv-%j>wiu&c2d( zzI5eQoqs3G$`Z;HkLeuzs<@KPdFt6d0g;p8hwk6s=<&2!=bydsrXRahA=%7>RHFyoB?z(`Ltp zvzwgy3X~lm8)u~l`M!I%^tj}@>kj>sJ~M1zVyeZl?!^z))z|ZniAZ#AYgK1roh`%t z&Pgy$tKT|-?S9wnZ^0*+{#c3pTb}B&Uz+#Sq9s8Rq0?n@c6_+VZ`IE|YwU+%fnRyrqe)q)6Xfxf42&(w0Se#gZad|}6w9lyhm*xf9a zU}!NeTH(PK7_#x0nC=EUV;%3N(#2L^G~`Yj*My5nna>Mct$4pc%-1F>`t7BAwY=-p zZOx~JeAP|ctWa*XHGQApf#abew{IU(=hkY|X`U*s)02K-=11nK%il<5t*!UAajy1I z-=mN^H|!IqJ|1jalYs}SMbxew)~vZ2IKTYmtq*=H_c(5WxBdwZIg-AQjrCBEux%-y=&AtSJA z+n%5GA0GaC%q1G?@U^~r^+JucCr>m>i3Bf^-Sk>^>O!uD7YpATo4-Bv`lH^hcs5`0 z|Ems9y>rVa_nP#C^&%gI>e8}y6m7rfy+I*Z%Kz>3x|!!oJz_$$>$g9iaw1JSygf>C zjz;M|rmKGqj%b!HzpP-#<*I&2OyW^;+{DB@=ZRNK-kq&i(-zZhF)loE%HD$eW5Bi9 zyqbcd2TdA<>rVri?0{d@2vWMdTA=_moBLIlBQRsFw$yO~nN zscqhj62&G;0XA>`*MHsVpQUSKWm;sXSR8rnw{7gf%ae@KX5YCed`IRotC#Wd4;jg; zx*GQ#+H$74YEeUa+78F+^A;r$0&RxNc#5VARCg@@{v_htSC7=?2h-fl4_SRpZ+joH z!TxT9PR+u@->3I6PjlU^Vp8TYquP<(=6xn2M_q<#*W2U=8b7siT2)|UvkkGTb`JeQ<3*If~ zK0Gs+t*UMN1MTOHMeOmeoXh)9um5kU^OtA)3+MG8G~EQZq@Lwj^>u^pJEnc>R_DeU zXg~MO+wM8*&BvwwH=^qJw-o(&b*sMQ)9o#54hucuy_ayhuPkQ5?vC0lfxKf&QsS33 z7Mpl{;oNwZGjH8b6T^QYDf?Cbyp*48qNaHKtljSi52x@Q*z}XyqD@ zf9OQxw)-D)%8g;n7w^K65A=1jYUZ_Q9-5PNJeb53pX-e1r5TTgG!Y3@ZmZolY3N{3l#B%BTq~@iUWGEOK8!14>n`BR) z=4E6QX?^&)|G5OuW7`{^8b_jdb6&b|mRU{Qc&)*OwM*f7-o8IOEyE|(bxuianR43H z%y_d&u(9FN$OE6HcTZh8lSOp-jua W6s4wd85&v`n3{5_s=E5SaRC78g2?v( 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. \metax{select next/previous state}{S-LEFT/RIGHT} \metax{select next/previous set}{C-S-LEFT/RIGHT} \key{toggle ORDERED property}{C-c C-x o} -\key{view TODO items in a sparse tree}{C-c C-v} -\key{view 3rd TODO keyword's sparse tree}{C-3 C-c C-v} +\key{view TODO items in a sparse tree}{C-c / t} +\key{view 3rd TODO keyword's sparse tree}{C-3 C-c / t} \key{set the priority of the current item}{C-c , [ABC]} \key{remove priority cookie from current item}{C-c , SPC} \key{raise/lower priority of current item}{S-UP/DOWN\notetwo} 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 @@ +2012-10-26 Achim Gratz + + * ob-ditaa.el: Needs to (require 'org-compat) for + org-find-library-dir. + + * org.el: Remove utf-8 codepoints in docstrings, bytecode doesn't + work when loaded from compressed files. + + * org-compat.el: Make sure that file-name-directory is getting a + stringp. This avoids a possible " (wrong-type-argument stringp + nil)" error when the library in question does not exist. + + * org-odt.el: Replace arc-mode.el by arc-mode. + + * org.el: Replace org-macs.el by org-macs. + + * org-install.el: Provide an empty file that prints a warning + about an outdated configuration. + +2012-10-26 Bastien Guerry + + * org-latex.el (org-export-as-latex): Remove obsolete argument + `hidden'. Also fix the docstring: using 'string as the value + for `to-buffer' outputs a string with no LaTeX header. + (org-export-as-latex-batch) + (org-export-as-latex-to-buffer, org-export-region-as-latex) + (org-export-as-pdf): Don't use the obsoleted argument. + + * ob-haskell.el (org-export-as-latex): Don't use the obsoleted + argument `hidden'. + + * org.el (org-refile): Run within `with-demoted-errors' so + that a corrupted bookmark file does not stop the refile + process. + + * org-capture.el (org-capture-bookmark-last-stored-position): + Ditto for the capture process. + + * org-src.el (org-edit-src-exit): Fix bug when saving an empty + source buffer. + + * org-lparse.el (org-lparse): Fix bug by returning the output + of `org-do-lparse'. + + * org.el (org-refile-check-position): Throw an error when the + refile target is the current buffer and is not a file. + (org-agenda-file-to-front, org-remove-file): Throw an error + when the current buffer is not a file. + (org-check-agenda-file): Enhance the message. + (org-element-type): Autoload. + (org-element-context, org-element-paragraph-parser): Don't + declare as these two functions are not used in org.el. + + * org-lparse.el (browse-url-file-url): Declare. + + * org.el (org-refile-check-position): Fix typo in docstring. + + * org-clock.el (org-clock-modeline-total): Make obsolete. + (org-clock-mode-line-total): Rename from + `org-clock-modeline-total'. + (org-clock-get-sum-start): Fix references to + `org-clock-modeline-total'. + + * org-faces.el (org-agenda-filter-tags) + (org-agenda-filter-category, mode-line): Use the 'mode-line + face instead of the obsolete 'modeline. + + * org-odt.el (org-odt-styles-dir): Try more directories. + Don't throw an error, just send a message. + + * org-odt.el (org-odt-lib-dir, org-odt-data-dir) + (org-odt-schema-dir-list, org-odt-styles-dir-list): Delete. + (org-export-odt-schema-dir, org-odt-styles-dir): Infer the + correct directories without requiring other variables. + + * org-fixup.el (org-make-org-version, org-make-autoloads): + Don't define `org-odt-data-dir' in org-version.el. + + * org-loaddefs.el: New file. + + * org.el ("org-loaddefs.el"): Don't throw an error if the file + cannot be fund. + (org-version): Use org-loaddefs.el instead of org-install.el. + + * org.el: Don't dynamically autoload already autoloaded + functions. + (org-clock-update-time-maybe): Move to org-clock.el. + + * org-exp.el (org-insert-export-options-template): Remove + autoload cookie. + + * org-clock.el (org-resolve-clocks, org-clock-in) + (org-clock-out, org-clock-cancel, org-clock-goto) + (org-clock-sum, org-clock-display, org-clock-report) + (org-dblock-write:clocktable): Add autoload cookie. + (org-clock-update-time-maybe): Moved from org.el. + + * org-beamer.el (org-beamer-sectioning, org-beamer-mode): Ditto. + + * org-ascii.el (org-export-ascii-preprocess): Ditto. + + * org-archive.el (org-archive-subtree) + (org-archive-to-archive-sibling, org-toggle-archive-tag): Add + autoload cookie. + + * org-colview.el (org-columns, org-dblock-write:columnview) + (org-insert-columns-dblock, org-agenda-columns): Ditto. + + * org-table.el (org-table-create-with-table.el) + (org-table-create-or-convert-from-region, org-table-create) + (org-table-convert-region, org-table-import) + (org-table-export, org-table-align) + (org-table-justify-field-maybe, org-table-next-field) + (org-table-previous-field, org-table-next-row) + (org-table-copy-down, org-table-field-info) + (org-table-current-dline, org-table-goto-column) + (org-table-insert-column, org-table-delete-column) + (org-table-move-column-right, org-table-move-column-left) + (org-table-move-column, org-table-move-row-down) + (org-table-move-row-up, org-table-move-row) + (org-table-insert-row, org-table-insert-hline) + (org-table-hline-and-move, org-table-kill-row) + (org-table-sort-lines, org-table-cut-region) + (org-table-copy-region, org-table-paste-rectangle) + (org-table-convert, org-table-wrap-region) + (org-table-edit-field, org-table-sum) + (org-table-get-stored-formulas) + (org-table-maybe-eval-formula) + (org-table-rotate-recalc-marks) + (org-table-maybe-recalculate-line, org-table-eval-formula) + (org-table-recalculate, org-table-iterate) + (org-table-edit-formulas) + (org-table-toggle-coordinate-overlays) + (org-table-toggle-formula-debugger, orgtbl-to-generic) + (orgtbl-to-tsv, orgtbl-to-csv, orgtbl-to-latex) + (orgtbl-to-html, orgtbl-to-texinfo, orgtbl-to-orgtbl): Ditto. + + * org.el (turn-on-orgtbl): Moved here from org-table.el. + (org-clock-persistence-insinuate): Moved here from org-clock.el. + (org-update-all-dblocks, org-map-entries) + (org-require-autoloaded-modules, org-forward-element) + (org-backward-element, org-up-element) + (org-element-greater-elements, org-drag-element-backward) + (org-drag-element-forward, org-mark-element) + (org-narrow-to-element, org-transpose-element) + (org-unindent-buffer): Don't autoload. + + * org-clock.el (org-clock-get-clocktable): Rename from + `org-get-clocktable'. + (org-clock-persistence-insinuate): Move to org.el. + + * org-capture.el: Do no set `generated-autoload-file' locally. + Minor code clean up. + + * org-agenda.el (org-agenda-list): Use + `org-clock-get-clocktable'. Do no set + `generated-autoload-file' locally. + + * org-table.el (org-table-iterate-buffer-tables): Minor + reformatting. + (turn-on-orgtbl): Move to org.el. + + * org-html.el (org-export-htmlize-generate-css): Don't autoload. + + * org-timer.el (org-timer-pause-or-continue, org-timer-stop): + Ditto. + + * ob-tangle.el (org-babel-tangle-lang-exts): Ditto. + + * ob-lob.el (org-babel-lob-ingest): Ditto. + + * org-id.el (org-id-copy) + (org-id-get-with-outline-path-completion) + (org-id-get-with-outline-drilling): Ditto. + + * org-lparse.el (org-lparse-and-open, org-lparse-batch) + (org-lparse-to-buffer, org-replace-region-by) + (org-lparse-region): Ditto. + + * org-mobile.el (org-mobile-create-sumo-agenda): Ditto. + + * org.el (org-cycle): Fix misplaced autoload cookie. + + * org-agenda.el (org-agenda-get-timestamps): Check if the item + is an habit when formatting it with `org-agenda-format-item'. + (org-agenda-get-blocks): Fix bug: don't assume the item is an + habit when formatting with `org-agenda-format-item'. + + * org.el (org-calendar-agenda-action-key): Delete an option. + (org-mode-map): Delete its keybinding. + (org-agenda-action-marker, org-mark-entry-for-agenda-action): + Delete. + + * org-agenda.el (org-agenda-diary-entry): Don't prevent from + being used outside of Org agendas, as it can be used in + calendar buffers too. + +2012-10-26 Caio Tiago Oliveira (tiny change) + + * ob-scala.el (org-babel-scala-wrapper-method): Use a Scala + block enclosing the submitted code. + +2012-10-26 Myles English (tiny change) + + * org-clock.el (org-clock-in): Moved the call to + org-clock-in-prepare-hook until the task's properties + can be accessed. + +2012-10-26 Nicolas Goaziou + + * org.el (org-auto-fill-function): Make sure `adaptive-fill-mode' + mode is nil when pre-computed `fill-prefix' is the empty string. + Otherwise filling functions from fill.el think it has to be computed + again and overwrite it. + + * org.el: Make `org-closest-date' aware of hours repeaters. + + * org.el (org-end-of-line): Do not call `end-of-visual-line' when + moving to the end of line. Also improve behaviour on elements that + can be hidden. + + * org.el (org-sparse-tree): Allow to call `org-show-todo-tree' + with an argument. + + * org-element.el (org-element--get-next-object-candidates): Fix + parsing of objects of the same type in a single paragraph. + + * org-element.el (org-element-sub/superscript-successor): Fix + parsing of sub/superscript at beginning of item. + (org-element-latex-or-entity-successor): Fix parsing of latex + fragments at beginning of item. + + * org-agenda.el (org-agenda-later): Fix function when span is + a number and an argument was provided. Also fix typo in docstring. + + * org.el (org-read-date-analyze): Fix analyzing for dates like + "29.03 16:40". + + * org-element.el (org-element-center-block-parser) + (org-element-drawer-parser, , org-element-footnote-definition-parser) + (org-element-inlinetask-parser, org-element-plain-list-parser) + (org-element-quote-block-parser, org-element-special-block-parser) + (org-element-babel-call-parser, org-element-clock-parser) + (org-element-comment-parser, org-element-comment-block-parser) + (org-element-example-block-parser, org-element-export-block-parser) + (org-element-fixed-width-parser, org-element-horizontal-rule-parser) + (org-element-keyword-parser, org-element-latex-environment-parser) + (org-element-paragraph-parser, org-element-planning-parser) + (org-element-property-drawer-parser, org-element-src-block-parser) + (org-element-table-parser) + (org-element-verse-block-parserorg-element-dynamic-block-parser): + Make sure element never ends at the end of a blank non-empty line. + + * org-element.el (org-element-context) + (org-element--get-next-object-candidates): Fix `org-element-context'. + In particular, the restrictions for an object may be different from + those of its container (i.e. table rows and table cells). + + * org-element.el (org-element-example-block-parser) + (org-element-src-block-parser): Store value of example-blocks and + src-blocks unescaped. + (org-element-example-block-interpreter) + (org-element-src-block-interpreter): Escape value again when storing + it. + + * org-src.el (org-escape-code-in-string) + (org-unescape-code-in-string, org-escape-code-in-region) + (org-unescape-code-in-region): New functions. + (org-edit-src-code, org-edit-src-exit): Use new functions. + + * org.el (org-strip-protective-commas): Removed function. + + * org-exp.el (org-export-select-backend-specific-text): Use new + function. + + * ob.el (org-babel-parse-src-block-match) + (org-babel-parse-inline-src-block-match, org-babel-insert-result): + Always escape produced blocks, independently on the language of the + block, if any. Use new functions. + + * org-element.el (org-element-paragraph-parser): Fix regexp + starting a block. + + * org-element.el (org-element-center-block-parser): + (org-element-drawer-parser, org-element-dynamic-block-parser) + (org-element-example-block-parser, org-element-export-block-parser) + (org-element-latex-environment-parser, org-element-paragraph-parser) + (org-element-property-drawer-parser, org-element-src-block-parser) + (org-element-verse-block-parser): Use stricter regexps for boundaries + of elements. + +2012-10-26 Toby S. Cubitt + + * org-agenda.el (org-agenda-get-sexps): Reset `extra' to nil at + beginning of re-search-forward loop, otherwise next iteration picks up + `extra' value from previous entry. + 2012-09-30 Abdó Roig-Maranges * 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 @@ ;;; Code: (require 'ob) +(require 'org-compat) (defvar org-ditaa-jar-path) ;; provided by org-exp-blocks 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." (format "%S" var))) (defvar org-src-preserve-indentation) +(declare-function org-export-as-latex "org-latex" + (arg &optional ext-plist to-buffer body-only pub-dir)) (defun org-babel-haskell-export-to-lhs (&optional arg) "Export to a .lhs file with all haskell code blocks escaped. 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 @@ (require 'ob-eval) (eval-when-compile (require 'cl)) +(defvar org-babel-tangle-lang-exts) ;; Autoloaded (add-to-list 'org-babel-tangle-lang-exts '("io" . "io")) (defvar org-babel-default-header-args:io '()) (defvar org-babel-io-command "io" "Name of the command to use for executing Io code.") - (defun org-babel-execute:io (body params) "Execute a block of Io code with org-babel. This function is 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'.") (provide 'ob-keys) - +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: ;;; 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." (defvar org-babel-default-lob-header-args '((:exports . "results")) "Default header arguments to use when exporting #+lob/call lines.") -;;;###autoload (defun org-babel-lob-ingest (&optional file) "Add all named source-blocks defined in FILE to `org-babel-library-of-babel'." @@ -143,6 +142,8 @@ if so then run the appropriate source block from the Library." (provide 'ob-lob) - +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: ;;; 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 @@ (eval-when-compile (require 'cl)) (declare-function run-picolisp "ext:inferior-picolisp" (cmd)) +(defvar org-babel-tangle-lang-exts) ;; Autoloaded ;; optionally define a file extension for this language (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 @@ (declare-function org-at-item-p "org-list" ()) (declare-function org-narrow-to-subtree "org" ()) (declare-function org-id-find-id-in-file "org-id" (id file &optional markerp)) +(declare-function org-id-find-id-file "org-id" (id)) (declare-function org-show-context "org" (&optional key)) (declare-function org-pop-to-buffer-same-window "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 @@ (require 'ob-eval) (eval-when-compile (require 'cl)) +(defvar org-babel-tangle-lang-exts) ;; Autoloaded (add-to-list 'org-babel-tangle-lang-exts '("scala" . "scala")) (defvar org-babel-default-header-args:scala '()) (defvar org-babel-scala-command "scala" "Name of the command to use for executing Scala code.") - (defun org-babel-execute:scala (body params) "Execute a block of Scala code with org-babel. This function is called by `org-babel-execute-src-block'" @@ -72,9 +72,17 @@ Emacs-lisp table, otherwise return the results as a string." (defvar org-babel-scala-wrapper-method - "( + +"var str_result :String = null; + +Console.withOut(new java.io.OutputStream() {def write(b: Int){ +}}) { + str_result = { %s -) asString print + }.toString +} + +print(str_result) ") 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 @@ (eval-when-compile (require 'cl)) (declare-function org-table-import "org-table" (file arg)) -(declare-function orgtbl-to-csv "org-table" (TABLE PARAMS)) +(declare-function orgtbl-to-csv "org-table" (table params)) +(declare-function org-table-to-lisp "org-table" (&optional txt)) (defvar org-babel-default-header-args:sql '()) 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 @@ (declare-function org-fill-template "org" (template alist)) (declare-function org-table-convert-region "org-table" (beg0 end0 &optional separator)) -(declare-function orgtbl-to-csv "org-table" (TABLE PARAMS)) +(declare-function orgtbl-to-csv "org-table" (table params)) +(declare-function org-table-to-lisp "org-table" (&optional txt)) (defvar org-babel-default-header-args:sqlite '()) 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 @@ (declare-function org-babel-update-block-body "org" (new-body)) (declare-function make-directory "files" (dir &optional parents)) -;;;###autoload (defcustom org-babel-tangle-lang-exts '(("emacs-lisp" . "el")) "Alist mapping languages to their file extensions. @@ -514,6 +513,8 @@ which enable the original code blocks to be found." (provide 'ob-tangle) - +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: ;;; 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 @@ (declare-function show-all "outline" ()) (declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS)) (declare-function org-mark-ring-push "org" (&optional pos buffer)) -(declare-function org-strip-protective-commas "org" (beg end)) (declare-function tramp-compat-make-temp-file "tramp-compat" (filename &optional dir-flag)) (declare-function tramp-dissect-file-name "tramp" (name &optional nodefault)) @@ -64,7 +63,6 @@ (declare-function org-cycle "org" (&optional arg)) (declare-function org-uniquify "org" (list)) (declare-function org-current-level "org" ()) -(declare-function org-strip-protective-commas "org" (beg end)) (declare-function org-table-import "org-table" (file arg)) (declare-function org-add-hook "org-compat" (hook function &optional append local)) @@ -87,10 +85,11 @@ (declare-function org-list-struct "org-list" ()) (declare-function org-list-prevs-alist "org-list" (struct)) (declare-function org-list-get-list-end "org-list" (item struct prevs)) -(declare-function org-strip-protective-commas "org" (beg end)) (declare-function org-remove-if "org" (predicate seq)) (declare-function org-completing-read "org" (&rest args)) -(declare-function org-add-protective-commas "org-src" (beg end)) +(declare-function org-escape-code-in-region "org-src" (beg end)) +(declare-function org-unescape-code-in-string "org-src" (s)) +(declare-function org-table-to-lisp "org-table" (&optional txt)) (defgroup org-babel nil "Code block evaluation and management in `org-mode' documents." @@ -494,8 +493,8 @@ can not be resolved.") ;;; functions (defvar call-process-region) -;;;###autoload +;;;###autoload (defun org-babel-execute-src-block (&optional arg info params) "Execute the current source code block. Insert the results of execution into the buffer. Source code @@ -838,6 +837,7 @@ evaluation mechanisms." (key-binding (or key (read-key-sequence nil)))))) (defvar org-bracket-link-regexp) + ;;;###autoload (defun org-babel-open-src-block-result (&optional re-run) "If `point' is on a src block then open the results of the @@ -944,6 +944,7 @@ buffer." (def-edebug-spec org-babel-map-inline-src-blocks (form body)) (defvar org-babel-lob-one-liner-regexp) + ;;;###autoload (defmacro org-babel-map-call-lines (file &rest body) "Evaluate BODY forms on each call line in FILE. @@ -1241,7 +1242,7 @@ may be specified in the properties of the current outline entry." ;; get block body less properties, protective commas, and indentation (with-temp-buffer (save-match-data - (insert (org-babel-strip-protective-commas body lang)) + (insert (org-unescape-code-in-string body)) (unless preserve-indentation (org-do-remove-indentation)) (buffer-string))) (org-babel-merge-params @@ -1258,8 +1259,7 @@ may be specified in the properties of the current outline entry." (let* ((lang (org-no-properties (match-string 2))) (lang-headers (intern (concat "org-babel-default-header-args:" lang)))) (list lang - (org-babel-strip-protective-commas - (org-no-properties (match-string 5)) lang) + (org-unescape-code-in-string (org-no-properties (match-string 5))) (org-babel-merge-params org-babel-default-inline-header-args (org-babel-params-from-properties lang) @@ -1937,10 +1937,10 @@ code ---- the results are extracted in the syntax of the source ((member "prepend" result-params)))) ; already there (setq results-switches (if results-switches (concat " " results-switches) "")) - (let ((wrap (lambda (start finish &optional escape) + (let ((wrap (lambda (start finish) (goto-char end) (insert (concat finish "\n")) (goto-char beg) (insert (concat start "\n")) - (if escape (org-add-protective-commas (point) end)) + (org-escape-code-in-region (point) end) (goto-char end) (goto-char (point-at-eol)) (setq end (point-marker)))) (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 ((member "latex" result-params) (funcall wrap "#+BEGIN_LaTeX" "#+END_LaTeX")) ((member "org" result-params) - (funcall wrap "#+BEGIN_SRC org" "#+END_SRC" 'escape)) + (funcall wrap "#+BEGIN_SRC org" "#+END_SRC")) ((member "code" result-params) (funcall wrap (format "#+BEGIN_SRC %s%s" (or lang "none") results-switches) "#+END_SRC")) @@ -2370,17 +2370,6 @@ block but are passed literally to the \"example-block\"." (funcall nb-add (buffer-substring index (point-max)))) new-body)) -(defun org-babel-strip-protective-commas (body &optional lang) - "Strip protective commas from bodies of source blocks." - (with-temp-buffer - (insert body) - (if (and lang (string= lang "org")) - (progn (goto-char (point-min)) - (while (re-search-forward "^[ \t]*\\(,\\)" nil t) - (replace-match "" nil nil nil 1))) - (org-strip-protective-commas (point-min) (point-max))) - (buffer-string))) - (defun org-babel-script-escape (str &optional force) "Safely convert tables into elisp lists." (let (in-single in-double out) @@ -2599,6 +2588,8 @@ of `org-babel-temporary-directory'." (provide 'ob) - +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: ;;; 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." :version "24.3" :type 'boolean) + ;;;###autoload (defun org-toggle-sticky-agenda (&optional arg) "Toggle `org-agenda-sticky'." @@ -1888,6 +1889,11 @@ When nil, `q' will kill the single agenda buffer." (message "Sticky agenda was %s" (if org-agenda-sticky "enabled" "disabled")))))) +(autoload 'org-toggle-sticky-agenda "org-agenda" "\ +Toggle `org-agenda-sticky'. + +\(fn &optional ARG)" t nil) + (defvar org-agenda-buffer nil "Agenda buffer currently being generated.") @@ -2563,6 +2569,43 @@ Pressing `<' twice means to restrict to the current subtree or region ((equal org-keys "!") (customize-variable 'org-stuck-projects)) (t (error "Invalid agenda key")))))) +(autoload 'org-agenda "org-agenda" "\ +Dispatch agenda commands to collect entries to the agenda buffer. +Prompts for a command to execute. Any prefix arg will be passed +on to the selected command. The default selections are: + +a Call `org-agenda-list' to display the agenda for current day or week. +t Call `org-todo-list' to display the global todo list. +T Call `org-todo-list' to display the global todo list, select only + entries with a specific TODO keyword (the user gets a prompt). +m Call `org-tags-view' to display headlines with tags matching + a condition (the user is prompted for the condition). +M Like `m', but select only TODO entries, no ordinary headlines. +L Create a timeline for the current buffer. +e Export views to associated files. +s Search entries for keywords. +S Search entries for keywords, only with TODO keywords. +/ Multi occur across all agenda files and also files listed + in `org-agenda-text-search-extra-files'. +< Restrict agenda commands to buffer, subtree, or region. + Press several times to get the desired effect. +> Remove a previous restriction. +# List \"stuck\" projects. +! Configure what \"stuck\" means. +C Configure custom agenda commands. + +More commands can be added by configuring the variable +`org-agenda-custom-commands'. In particular, specific tags and TODO keyword +searches can be pre-defined in this way. + +If the current buffer is in Org-mode and visiting a file, you can also +first press `<' once to indicate that the agenda should be temporarily +\(until the next use of \\[org-agenda]) restricted to the current file. +Pressing `<' twice means to restrict to the current subtree or region +\(if active). + +\(fn &optional ARG ORG-KEYS RESTRICTION)" t nil) + (defun org-agenda-append-agenda () "Append another agenda view to the current one. This function allows interactive building of block agendas. @@ -2857,6 +2900,16 @@ before running the agenda command." (org-agenda nil cmd-key))) (set-buffer org-agenda-buffer-name) (princ (buffer-string))) + +(autoload 'org-batch-agenda "org-agenda" "\ +Run an agenda command in batch mode and send the result to STDOUT. +If CMD-KEY is a string of length 1, it is used as a key in +`org-agenda-custom-commands' and triggers this command. If it is a +longer string it is used as a tags/todo match string. +Parameters are alternating variable names and values that will be bound +before running the agenda command. + +\(fn CMD-KEY &rest PARAMETERS)" nil t) (def-edebug-spec org-batch-agenda (form &rest sexp)) (defvar org-agenda-info nil) @@ -2915,6 +2968,43 @@ agenda-day The day in the agenda where this is listed" priority-letter priority agenda-day) ",")) (princ "\n"))))) + +(autoload 'org-batch-agenda-csv "org-agenda" "\ +Run an agenda command in batch mode and send the result to STDOUT. +If CMD-KEY is a string of length 1, it is used as a key in +`org-agenda-custom-commands' and triggers this command. If it is a +longer string it is used as a tags/todo match string. +Parameters are alternating variable names and values that will be bound +before running the agenda command. + +The output gives a line for each selected agenda item. Each +item is a list of comma-separated values, like this: + +category,head,type,todo,tags,date,time,extra,priority-l,priority-n + +category The category of the item +head The headline, without TODO kwd, TAGS and PRIORITY +type The type of the agenda entry, can be + todo selected in TODO match + tagsmatch selected in tags match + diary imported from diary + deadline a deadline on given date + scheduled scheduled on given date + timestamp entry has timestamp on given date + closed entry was closed on given date + upcoming-deadline warning about deadline + past-scheduled forwarded scheduled item + block entry has date block including g. date +todo The todo keyword, if any +tags All tags including inherited ones, separated by colons +date The relevant date, like 2007-2-14 +time The time, like 15:00-16:50 +extra Sting with extra planning info +priority-l The priority letter if any was given +priority-n The computed numerical priority +agenda-day The day in the agenda where this is listed + +\(fn CMD-KEY &rest PARAMETERS)" nil t) (def-edebug-spec org-batch-agenda-csv (form &rest sexp)) (defun org-fix-agenda-info (props) @@ -2964,6 +3054,11 @@ This ensures the export commands can easily use it." (interactive) (eval (list 'org-batch-store-agenda-views))) +(autoload 'org-store-agenda-views "org-agenda" "\ + + +\(fn &rest PARAMETERS)" t nil) + ;;;###autoload (defmacro org-batch-store-agenda-views (&rest parameters) "Run all custom agenda commands that have a file argument." @@ -2998,6 +3093,11 @@ This ensures the export commands can easily use it." (org-agenda-write (expand-file-name (pop files) dir) nil t bufname))) (and (get-buffer bufname) (kill-buffer bufname))))))) + +(autoload 'org-batch-store-agenda-views "org-agenda" "\ +Run all custom agenda commands that have a file argument. + +\(fn &rest PARAMETERS)" nil t) (def-edebug-spec org-batch-store-agenda-views (&rest sexp)) (defvar org-agenda-current-span nil @@ -4002,7 +4102,7 @@ given in `org-agenda-start-on-weekday'." "" x)) filter "")))) - (setq tbl (apply 'org-get-clocktable p)) + (setq tbl (apply 'org-clock-get-clocktable p)) (insert tbl))) (goto-char (point-min)) (or org-agenda-multi (org-agenda-fit-window-to-buffer)) @@ -4026,6 +4126,20 @@ given in `org-agenda-start-on-weekday'." (setq buffer-read-only t) (message "")))) +(autoload 'org-agenda-list "org-agenda" "\ +Produce a daily/weekly view from all files in variable `org-agenda-files'. +The view will be for the current day or week, but from the overview buffer +you will be able to go to other days/weeks. + +With a numeric prefix argument in an interactive call, the agenda will +span ARG days. Lisp programs should instead specify SPAN to change +the number of days. SPAN defaults to `org-agenda-span'. + +START-DAY defaults to TODAY, or to the most recent match for the weekday +given in `org-agenda-start-on-weekday'. + +\(fn &optional ARG START-DAY SPAN)" t nil) + (defun org-agenda-ndays-to-span (n) "Return a span symbol for a span of N days, or N if none matches." (cond ((symbolp n) n) @@ -4328,6 +4442,52 @@ in `org-agenda-text-search-extra-files'." (org-agenda-finalize) (setq buffer-read-only t)))) +(autoload 'org-search-view "org-agenda" "\ +Show all entries that contain a phrase or words or regular expressions. + +With optional prefix argument TODO-ONLY, only consider entries that are +TODO entries. The argument STRING can be used to pass a default search +string into this function. If EDIT-AT is non-nil, it means that the +user should get a chance to edit this string, with cursor at position +EDIT-AT. + +The search string can be viewed either as a phrase that should be found as +is, or it can be broken into a number of snippets, each of which must match +in a Boolean way to select an entry. The default depends on the variable +`org-agenda-search-view-always-boolean'. +Even if this is turned off (the default) you can always switch to +Boolean search dynamically by preceding the first word with \"+\" or \"-\". + +The default is a direct search of the whole phrase, where each space in +the search string can expand to an arbitrary amount of whitespace, +including newlines. + +If using a Boolean search, the search string is split on whitespace and +each snippet is searched separately, with logical AND to select an entry. +Words prefixed with a minus must *not* occur in the entry. Words without +a prefix or prefixed with a plus must occur in the entry. Matching is +case-insensitive. Words are enclosed by word delimiters (i.e. they must +match whole words, not parts of a word) if +`org-agenda-search-view-force-full-words' is set (default is nil). + +Boolean search snippets enclosed by curly braces are interpreted as +regular expressions that must or (when preceded with \"-\") must not +match in the entry. Snippets enclosed into double quotes will be taken +as a whole, to include whitespace. + +- If the search string starts with an asterisk, search only in headlines. +- If (possibly after the leading star) the search string starts with an + exclamation mark, this also means to look at TODO entries only, an effect + that can also be achieved with a prefix argument. +- If (possibly after star and exclamation mark) the search string starts + with a colon, this will mean that the (non-regexp) snippets of the + Boolean search must match as full words. + +This command searches the agenda files, and in addition the files listed +in `org-agenda-text-search-extra-files'. + +\(fn &optional TODO-ONLY STRING EDIT-AT)" t nil) + ;;; Agenda TODO list (defvar org-select-this-todo-keyword nil) @@ -4418,6 +4578,15 @@ for a keyword. A numeric prefix directly selects the Nth keyword in (org-agenda-finalize) (setq buffer-read-only t)))) +(autoload 'org-todo-list "org-agenda" "\ +Show all (not done) TODO entries from all agenda file in a single list. +The prefix arg can be used to select a specific TODO keyword and limit +the list to these. When using \\[universal-argument], you will be prompted +for a keyword. A numeric prefix directly selects the Nth keyword in +`org-todo-keywords-1'. + +\(fn &optional ARG)" t nil) + ;;; Agenda tags match ;;;###autoload @@ -4503,6 +4672,12 @@ The prefix arg TODO-ONLY limits the search to TODO entries." (org-agenda-finalize) (setq buffer-read-only t)))) +(autoload 'org-tags-view "org-agenda" "\ +Show all headlines for all `org-agenda-files' matching a TAGS criterion. +The prefix arg TODO-ONLY limits the search to TODO entries. + +\(fn &optional TODO-ONLY MATCH)" t nil) + ;;; Agenda Finding stuck projects (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 (setq org-agenda-redo-command `(org-agenda-list-stuck-projects ,current-prefix-arg))))) +(autoload 'org-agenda-list-stuck-projects "org-agenda" "\ +Create agenda view for projects that are stuck. +Stuck projects are project that have no next actions. For the definitions +of what a project is and how to check if it stuck, customize the variable +`org-stuck-projects'. + +\(fn &rest IGNORE)" t nil) + ;;; Diary integration (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." (if results (concat (org-agenda-finalize-entries results) "\n")))) +(autoload 'org-diary "org-agenda" "\ +Return diary information from org files. +This function can be used in a \"sexp\" diary entry in the Emacs calendar. +It accesses org files and extracts information from those files to be +listed in the diary. The function accepts arguments specifying what +items should be listed. For a list of arguments allowed here, see the +variable `org-agenda-entry-types'. + +The call in the diary file should look like this: + + &%%(org-diary) ~/path/to/some/orgfile.org + +Use a separate line for each org file to check. Or, if you omit the file name, +all files listed in `org-agenda-files' will be checked automatically: + + &%%(org-diary) + +If you don't give any arguments (as in the example above), the default +arguments (:deadline :scheduled :timestamp :sexp) are used. +So the example above may also be written as + + &%%(org-diary :deadline :timestamp :sexp :scheduled) + +The function expects the lisp variables `entry' and `date' to be provided +by the caller, because this is how the calendar works. Don't use this +function from a program - use `org-agenda-get-day-entries' instead. + +\(fn &rest ARGS)" nil nil) + ;;; Agenda entry finders (defun org-agenda-get-day-entries (file date &rest args) @@ -5035,7 +5247,6 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', (>= days n) (<= days n)))) -;;;###autoload (defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item (&optional end) "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', (match-string 1) org-agenda-todo-ignore-timestamp)) (t)))))))))) +(autoload 'org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item "org-agenda" "\ +Do we have a reason to ignore this TODO entry because it has a time stamp? + +\(fn &optional END)" nil nil) + (defconst org-agenda-no-heading-message "No heading for this item in buffer or region.") @@ -5133,12 +5349,13 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) marker hdmarker deadlinep scheduledp clockp closedp inactivep donep tmp priority category category-pos ee txt timestr tags - b0 b3 e3 head todo-state end-of-match show-all warntime) + b0 b3 e3 head todo-state end-of-match show-all warntime habitp) (goto-char (point-min)) (while (setq end-of-match (re-search-forward regexp nil t)) (setq b0 (match-beginning 0) b3 (match-beginning 3) e3 (match-end 3) todo-state (save-match-data (ignore-errors (org-get-todo-state))) + habitp (and (functionp 'org-is-habit-p) (save-match-data (org-is-habit-p))) show-all (or (eq org-agenda-repeating-timestamp-show-all t) (member todo-state org-agenda-repeating-timestamp-show-all))) @@ -5190,7 +5407,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', (setq txt (org-agenda-format-item (if inactivep org-agenda-inactive-leader nil) head category tags timestr - remove-re t))) + remove-re habitp))) (setq priority (org-get-priority txt)) (org-add-props txt props 'org-marker marker 'org-hd-marker hdmarker) @@ -5237,7 +5454,8 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', tags (save-excursion (org-backward-heading-same-level 0) (org-get-tags-at)) todo-state (org-get-todo-state) - warntime (org-entry-get (point) "APPT_WARNTIME")) + warntime (org-entry-get (point) "APPT_WARNTIME") + extra nil) (dolist (r (if (stringp result) (list result) @@ -5848,7 +6066,7 @@ FRACTION is what fraction of the head-warning time has passed." (concat "<" start-time ">")) ((= d2 d0) (concat "<" end-time ">"))) - remove-re t)))) + remove-re)))) (org-add-props txt props 'org-marker marker 'org-hd-marker hdmarker 'type "block" 'date date @@ -7059,7 +7277,7 @@ Negative selection means regexp must not match for selection of an entry." (move-beginning-of-line 1))))) (defun org-agenda-later (arg) - "Go forward in time by thee current span. + "Go forward in time by the current span. With prefix ARG, go forward that many times the current span." (interactive "p") (org-agenda-check-type t 'agenda) @@ -7071,7 +7289,7 @@ With prefix ARG, go forward that many times the current span." greg2) (cond ((numberp span) - (setq sd (+ span sd))) + (setq sd (+ (* span arg) sd))) ((eq span 'day) (setq sd (+ arg sd))) ((eq span 'week) @@ -8654,7 +8872,6 @@ When `org-agenda-diary-file' points to a file, `org-agenda-diary-entry-in-org-file' is called instead to create entries in that Org-mode file." (interactive) - (org-agenda-check-type t 'agenda 'timeline) (if (not (eq org-agenda-diary-file 'diary-file)) (org-agenda-diary-entry-in-org-file) (require 'diary-lib) @@ -8765,6 +8982,12 @@ This is a command that has to be installed in `calendar-mode-map'." (calendar-cursor-to-date)) nil)) +(autoload 'org-calendar-goto-agenda "org-agenda" "\ +Compute the Org-mode agenda for the calendar date displayed at the cursor. +This is a command that has to be installed in `calendar-mode-map'. + +\(fn)" t nil) + (defun org-agenda-convert-date () (interactive) (org-agenda-check-type t 'agenda 'timeline) @@ -9207,6 +9430,40 @@ to override `appt-message-warning-time'." (message "No event to add") (message "Added %d event%s for today" cnt (if (> cnt 1) "s" ""))))) +(autoload 'org-agenda-to-appt "org-agenda" "\ +Activate appointments found in `org-agenda-files'. +With a \\[universal-argument] prefix, refresh the list of +appointments. + +If FILTER is t, interactively prompt the user for a regular +expression, and filter out entries that don't match it. + +If FILTER is a string, use this string as a regular expression +for filtering entries out. + +If FILTER is a function, filter out entries against which +calling the function returns nil. This function takes one +argument: an entry from `org-agenda-get-day-entries'. + +FILTER can also be an alist with the car of each cell being +either 'headline or 'category. For example: + + '((headline \"IMPORTANT\") + (category \"Work\")) + +will only add headlines containing IMPORTANT or headlines +belonging to the \"Work\" category. + +ARGS are symbols indicating what kind of entries to consider. +By default `org-agenda-to-appt' will use :deadline, :scheduled +and :timestamp entries. See the docstring of `org-diary' for +details and examples. + +If an entry as a APPT_WARNTIME property, its value will be used +to override `appt-message-warning-time'. + +\(fn &optional REFRESH FILTER &rest ARGS)" t nil) + (defun org-agenda-todayp (date) "Does DATE mean today, when considering `org-extend-today-until'?" (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." (file-name-nondirectory (buffer-file-name (buffer-base-buffer)))))) +;;;###autoload (defun org-archive-subtree (&optional find-done) "Move the current subtree to the archive. The archive can be a certain top-level heading in the current file, or in @@ -369,6 +370,7 @@ this heading." (if (looking-at "^[ \t]*$") (outline-next-visible-heading 1)))) +;;;###autoload (defun org-archive-to-archive-sibling () "Archive the current heading by moving it under the archive sibling. 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." (goto-char end))))) (message "%d trees archived" cntarch))) +;;;###autoload (defun org-toggle-archive-tag (&optional find-done) "Toggle the archive tag for the current headline. 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'." (provide 'org-archive) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (kill-buffer (current-buffer))) (current-buffer)))) +;;;###autoload (defun org-export-ascii-preprocess (parameters) "Do extra work for ASCII export." ;; @@ -726,4 +727,8 @@ publishing directory." (provide 'org-ascii) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (provide 'org-attach) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (add-hook 'bbdb-after-change-hook 'org-bbdb-updated) ;;;###autoload -(defun org-bbdb-anniversaries() +(defun org-bbdb-anniversaries () "Extract anniversaries from BBDB for display in the agenda." (require 'bbdb) (require 'diary-lib) @@ -433,4 +433,8 @@ END:VEVENT\n" (provide 'org-bbdb) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (org-entry-put nil "BEAMER_env" (match-string 1 tags))) (t (org-entry-delete nil "BEAMER_env")))))) - +;;;###autoload (defun org-beamer-sectioning (level text) "Return the sectioning entry for the current headline. LEVEL is the reduced level of the headline. @@ -370,6 +370,7 @@ org-beamer-extra are all scoped into this function dynamically." "The keymap for `org-beamer-mode'.") (define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment) +;;;###autoload (define-minor-mode org-beamer-mode "Special support for editing Org-mode files made to export to beamer." 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'." ;;; The main commands -;;;###autoload (defvar org-capture-initial nil) (defvar org-capture-entry nil) + +;;;###autoload (defun org-capture-string (string &optional keys) (interactive "sInitial text: \n") (let ((org-capture-initial string) @@ -1249,7 +1250,8 @@ Of course, if exact position has been required, just put it there." (save-restriction (widen) (goto-char pos) - (bookmark-set "org-capture-last-stored") + (with-demoted-errors + (bookmark-set "org-capture-last-stored")) (move-marker org-capture-last-stored-marker (point))))))) (defun org-capture-narrow (beg end) @@ -1280,7 +1282,7 @@ Point will remain at the first line after the inserted text." (goto-char pos))) (defvar org-clock-marker) ; Defined in org.el -;;;###autoload + (defun org-capture-insert-template-here () (let* ((template (org-capture-get :template)) (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" (const :tag "Standard beep" t) (file :tag "Play sound file"))) -(defcustom org-clock-modeline-total 'auto +(define-obsolete-variable-alias 'org-clock-modeline-total + 'org-clock-mode-line-total "24.3") + +(defcustom org-clock-mode-line-total 'auto "Default setting for the time included for the mode line clock. This can be overruled locally using the CLOCK_MODELINE_TOTAL property. Allowed values are: @@ -962,6 +965,7 @@ to be CLOCKED OUT."))) (not (memq ch '(?K ?G ?S ?C)))) fail-quietly))))) +;;;###autoload (defun org-resolve-clocks (&optional only-dangling-p prompt-fn last-valid) "Resolve all currently open org-mode clocks. If `only-dangling-p' is non-nil, only ask to resolve dangling @@ -1059,6 +1063,8 @@ so long." (setq org-clock-current-task nil)) (defvar org-clock-out-time nil) ; store the time of the last clock-out + +;;;###autoload (defun org-clock-in (&optional select start-time) "Start the clock on the current item. If necessary, clock-out of the currently active clock. @@ -1132,7 +1138,6 @@ make this the default behavior.)" (if (and (eobp) (not (org-at-heading-p))) (point-at-bol 0) (point))) - (run-hooks 'org-clock-in-prepare-hook) (save-excursion (when (and selected-task (marker-buffer selected-task)) ;; There is a selected task, move to the correct buffer @@ -1151,6 +1156,7 @@ make this the default behavior.)" ;; beginning of the heading, since the ;; user is liking to insert stuff here ;; manually + (run-hooks 'org-clock-in-prepare-hook) (org-clock-history-push)) (org-clock-set-current) (cond ((functionp org-clock-in-switch-to-state) @@ -1310,10 +1316,10 @@ for a todo state to switch to, overriding the existing value This is for the currently running clock as it is displayed in the mode line. This function looks at the properties LAST_REPEAT and in particular CLOCK_MODELINE_TOTAL and the -corresponding variable `org-clock-modeline-total' and then +corresponding variable `org-clock-mode-line-total' and then decides which time to use." (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL") - (symbol-name org-clock-modeline-total))) + (symbol-name org-clock-mode-line-total))) (lr (org-entry-get nil "LAST_REPEAT"))) (cond ((equal cmt "current") @@ -1428,6 +1434,7 @@ line and position cursor in that line." (and (re-search-forward org-property-end-re nil t) (goto-char (match-beginning 0)))))))) +;;;###autoload (defun org-clock-out (&optional switch-to-state fail-quietly at-time) "Stop the currently running clock. 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." ((eq org-ts-what 'year) (* 24 3600 365.2))))) org-ts-what 'updown))))))) +;;;###autoload (defun org-clock-cancel () "Cancel the running clock by removing the start timestamp." (interactive) @@ -1613,6 +1621,7 @@ UPDOWN tells whether to change 'up or 'down." (message "Clock canceled") (run-hooks 'org-clock-cancel-hook)) +;;;###autoload (defun org-clock-goto (&optional select) "Go to the currently clocked-in entry, or to the most recently clocked one. With prefix arg SELECT, offer recently clocked tasks for selection." @@ -1651,6 +1660,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection." (let ((range (org-clock-special-range 'today))) (org-clock-sum (car range) (cadr range) nil :org-clock-minutes-today))) +;;;###autoload (defun org-clock-sum (&optional tstart tend headline-filter propname) "Sum the times for each subtree. 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." (org-clock-sum tstart) org-clock-file-total-minutes))) +;;;###autoload (defun org-clock-display (&optional total-only) "Show subtree times in the entire buffer. 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." 'org-clock-out-if-current) ;;;###autoload -(defun org-get-clocktable (&rest props) +(defun org-clock-get-clocktable (&rest props) "Get a formatted clocktable with parameters according to PROPS. The table is created in a temporary buffer, fully formatted and fontified, and then returned." @@ -1879,6 +1890,7 @@ fontified, and then returned." (re-search-forward "^[ \t]*#\\+END" nil t) (point-at-bol))))) +;;;###autoload (defun org-clock-report (&optional arg) "Create a table containing a report about clocked time. If the cursor is inside an existing clocktable block, then the table @@ -2165,6 +2177,7 @@ the currently selected interval size." (org-update-dblock) t))))) +;;;###autoload (defun org-dblock-write:clocktable (params) "Write the standard clocktable." (setq params (org-combine-plists org-clocktable-defaults params)) @@ -2675,6 +2688,48 @@ This function is made for clock tables." (defvar org-clock-loaded nil "Was the clock file loaded?") +(defun org-clock-update-time-maybe () + "If this is a CLOCK line, update it and return t. +Otherwise, return nil." + (interactive) + (save-excursion + (beginning-of-line 1) + (skip-chars-forward " \t") + (when (looking-at org-clock-string) + (let ((re (concat "[ \t]*" org-clock-string + " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]" + "\\([ \t]*=>.*\\)?\\)?")) + ts te h m s neg) + (cond + ((not (looking-at re)) + nil) + ((not (match-end 2)) + (when (and (equal (marker-buffer org-clock-marker) (current-buffer)) + (> org-clock-marker (point)) + (<= org-clock-marker (point-at-eol))) + ;; The clock is running here + (setq org-clock-start-time + (apply 'encode-time + (org-parse-time-string (match-string 1)))) + (org-clock-update-mode-line))) + (t + (and (match-end 4) (delete-region (match-beginning 4) (match-end 4))) + (end-of-line 1) + (setq ts (match-string 1) + te (match-string 3)) + (setq s (- (org-float-time + (apply 'encode-time (org-parse-time-string te))) + (org-float-time + (apply 'encode-time (org-parse-time-string ts)))) + neg (< s 0) + s (abs s) + h (floor (/ s 3600)) + s (- s (* 3600 h)) + m (floor (/ s 60)) + s (- s (* 60 s))) + (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m)) + t)))))) + (defun org-clock-save () "Persist various clock-related data to disk. 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 (if (outline-invisible-p) (org-show-context)))))))))) -;;;###autoload -(defun org-clock-persistence-insinuate () - "Set up hooks for clock persistence." - (add-hook 'org-mode-hook 'org-clock-load) - (add-hook 'kill-emacs-hook 'org-clock-save)) - ;; Suggested bindings (org-defkey org-mode-map "\C-c\C-x\C-e" 'org-clock-modify-effort-estimate) (provide 'org-clock) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (move-marker org-columns-top-level-marker org-entry-property-inherited-from) (move-marker org-columns-top-level-marker (point)))) +;;;###autoload (defun org-columns (&optional columns-fmt-string) "Turn on column view on an org-mode file. When COLUMNS-FMT-STRING is non-nil, use it as the column format." @@ -1222,6 +1223,7 @@ of fields." (push row tbl))))) (append (list title 'hline) (nreverse tbl))))) +;;;###autoload (defun org-dblock-write:columnview (params) "Write the column view table. PARAMS is a property list of parameters: @@ -1334,6 +1336,7 @@ and tailing newline characters." (t (error "Garbage in listtable: %s" x)))) tbl "\n")) +;;;###autoload (defun org-insert-columns-dblock () "Create a dynamic block capturing a column view table." (interactive) @@ -1357,6 +1360,7 @@ and tailing newline characters." (defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el (defvar org-agenda-columns-add-appointments-to-effort-sum); as well +;;;###autoload (defun org-agenda-columns () "Turn on or update column view in the agenda." (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." (apply 'propertize string properties))) (defmacro org-find-library-dir (library) - `(file-name-directory (locate-library ,library))) + `(file-name-directory (or (locate-library ,library) ""))) (defun org-count-lines (s) "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." (provide 'org-datetree) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (provide 'org-docbook) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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', Assume point is at the beginning of the block." (let ((case-fold-search t)) (if (not (save-excursion - (re-search-forward "^[ \t]*#\\+END_CENTER" limit t))) + (re-search-forward "^[ \t]*#\\+END_CENTER[ \t]*$" limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((block-end-line (match-beginning 0))) @@ -494,7 +494,8 @@ Assume point is at the beginning of the block." (forward-line) (point))) (end (save-excursion (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'center-block (nconc (list :begin begin @@ -524,7 +525,7 @@ Return a list whose CAR is `drawer' and CDR is a plist containing Assume point is at beginning of drawer." (let ((case-fold-search t)) - (if (not (save-excursion (re-search-forward "^[ \t]*:END:" limit t))) + (if (not (save-excursion (re-search-forward "^[ \t]*:END:[ \t]*$" limit t))) ;; Incomplete drawer: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((drawer-end-line (match-beginning 0))) @@ -544,7 +545,8 @@ Assume point is at beginning of drawer." (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'drawer (nconc (list :begin begin @@ -578,7 +580,8 @@ containing `:block-name', `:begin', `:end', `:hiddenp', Assume point is at beginning of dynamic block." (let ((case-fold-search t)) - (if (not (save-excursion (re-search-forward org-dblock-end-re limit t))) + (if (not (save-excursion + (re-search-forward "^[ \t]*#\\+END:?[ \t]*$" limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((block-end-line (match-beginning 0))) @@ -598,7 +601,8 @@ Assume point is at beginning of dynamic block." (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'dynamic-block (nconc (list :begin begin @@ -653,7 +657,8 @@ Assume point is at the beginning of the footnote definition." (contents-end (and contents-begin ending)) (end (progn (goto-char ending) (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'footnote-definition (nconc (list :label label @@ -904,7 +909,8 @@ Assume point is at beginning of the inline task." (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol)))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position)))) (inlinetask (list 'inlinetask (nconc @@ -1108,7 +1114,8 @@ Assume point is at the beginning of the list." (unless (bolp) (forward-line)) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) ;; Return value. (list 'plain-list (nconc @@ -1145,7 +1152,7 @@ containing `:begin', `:end', `:hiddenp', `:contents-begin', Assume point is at the beginning of the block." (let ((case-fold-search t)) (if (not (save-excursion - (re-search-forward "^[ \t]*#\\+END_QUOTE" limit t))) + (re-search-forward "^[ \t]*#\\+END_QUOTE[ \t]*$" limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((block-end-line (match-beginning 0))) @@ -1162,7 +1169,8 @@ Assume point is at the beginning of the block." (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'quote-block (nconc (list :begin begin @@ -1227,7 +1235,8 @@ Assume point is at the beginning of the block." (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(S-+\\)") (upcase (match-string-no-properties 1))))) (if (not (save-excursion - (re-search-forward (concat "^[ \t]*#\\+END_" type) limit t))) + (re-search-forward + (format "^[ \t]*#\\+END_%s[ \t]*$" type) limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((block-end-line (match-beginning 0))) @@ -1243,8 +1252,9 @@ Assume point is at the beginning of the block." (pos-before-blank (progn (goto-char block-end-line) (forward-line) (point))) - (end (progn (org-skip-whitespace) - (if (eobp) (point) (point-at-bol))))) + (end (progn (skip-chars-forward " \r\t\n" limit) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'special-block (nconc (list :type type @@ -1295,7 +1305,8 @@ keywords." (begin (point-at-bol)) (pos-before-blank (progn (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'babel-call (list :begin begin :end end @@ -1338,7 +1349,8 @@ as keywords." (status (if time 'closed 'running)) (post-blank (let ((before-blank (progn (forward-line) (point)))) (skip-chars-forward " \r\t\n" limit) - (unless (eobp) (beginning-of-line)) + (skip-chars-backward " \t") + (unless (bolp) (end-of-line)) (count-lines before-blank (point)))) (end (point))) (list 'clock @@ -1396,7 +1408,8 @@ Assume point is at comment beginning." (point))) (end (progn (goto-char com-end) (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'comment (nconc (list :begin begin @@ -1425,7 +1438,7 @@ containing `:begin', `:end', `:hiddenp', `:value' and Assume point is at comment block beginning." (let ((case-fold-search t)) (if (not (save-excursion - (re-search-forward "^[ \t]*#\\+END_COMMENT" limit t))) + (re-search-forward "^[ \t]*#\\+END_COMMENT[ \t]*$" limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((contents-end (match-beginning 0))) @@ -1438,7 +1451,8 @@ Assume point is at comment block beginning." (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol)))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position)))) (value (buffer-substring-no-properties contents-begin contents-end))) (list 'comment-block @@ -1470,7 +1484,7 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent', `:switches', `:value' and `:post-blank' keywords." (let ((case-fold-search t)) (if (not (save-excursion - (re-search-forward "^[ \t]*#\\+END_EXAMPLE" limit t))) + (re-search-forward "^[ \t]*#\\+END_EXAMPLE[ \t]*$" limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((contents-end (match-beginning 0))) @@ -1502,12 +1516,15 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent', (begin (car keywords)) (contents-begin (progn (forward-line) (point))) (hidden (org-invisible-p2)) - (value (buffer-substring-no-properties contents-begin contents-end)) + (value (org-unescape-code-in-string + (buffer-substring-no-properties + contents-begin contents-end))) (pos-before-blank (progn (goto-char contents-end) (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'example-block (nconc (list :begin begin @@ -1529,7 +1546,8 @@ CONTENTS is nil." (let ((switches (org-element-property :switches example-block))) (concat "#+BEGIN_EXAMPLE" (and switches (concat " " switches)) "\n" (org-remove-indentation - (org-element-property :value example-block)) + (org-escape-code-in-string + (org-element-property :value example-block))) "#+END_EXAMPLE"))) @@ -1549,7 +1567,8 @@ Assume point is at export-block beginning." (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)") (upcase (org-match-string-no-properties 1))))) (if (not (save-excursion - (re-search-forward (concat "^[ \t]*#\\+END_" type) limit t))) + (re-search-forward + (format "^[ \t]*#\\+END_%s[ \t]*$" type) limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((contents-end (match-beginning 0))) @@ -1562,7 +1581,8 @@ Assume point is at export-block beginning." (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol)))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position)))) (value (buffer-substring-no-properties contents-begin contents-end))) (list 'export-block @@ -1612,7 +1632,8 @@ Assume point is at the beginning of the fixed-width area." (forward-line)) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'fixed-width (nconc (list :begin begin @@ -1642,7 +1663,8 @@ containing `:begin', `:end' and `:post-blank' keywords." (begin (car keywords)) (post-hr (progn (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'horizontal-rule (nconc (list :begin begin @@ -1675,7 +1697,8 @@ keywords." (match-end 0) (point-at-eol)))) (pos-before-blank (progn (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'keyword (list :key key :value value @@ -1711,12 +1734,14 @@ Assume point is at the beginning of the latex environment." (env (progn (looking-at "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}") (regexp-quote (match-string 1)))) (code-end - (progn (re-search-forward (format "^[ \t]*\\\\end{%s}" env) limit t) + (progn (re-search-forward + (format "^[ \t]*\\\\end{%s}[ \t]*$" env) limit t) (forward-line) (point))) (value (buffer-substring-no-properties code-begin code-end)) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'latex-environment (nconc (list :begin begin @@ -1744,69 +1769,80 @@ containing `:begin', `:end', `:contents-begin' and Assume point is at the beginning of the paragraph." (save-excursion - (let* (;; INNER-PAR-P is non-nil when paragraph is at the + (let* ((contents-begin (point)) + ;; INNER-PAR-P is non-nil when paragraph is at the ;; beginning of an item or a footnote reference. In that ;; case, we mustn't look for affiliated keywords since they ;; belong to the container. (inner-par-p (not (bolp))) - (contents-begin (point)) (keywords (unless inner-par-p (org-element--collect-affiliated-keywords))) (begin (if inner-par-p contents-begin (car keywords))) (before-blank (let ((case-fold-search t)) (end-of-line) - (re-search-forward org-element-paragraph-separate limit 'm) - (while (and (/= (point) limit) - (cond - ;; Skip non-existent or incomplete drawer. - ((save-excursion - (beginning-of-line) - (and (looking-at "[ \t]*:\\S-") - (or (not (looking-at org-drawer-regexp)) - (not (save-excursion - (re-search-forward - "^[ \t]*:END:" limit t))))))) - ;; Stop at comments. - ((save-excursion - (beginning-of-line) - (not (looking-at "[ \t]*#\\S-"))) nil) - ;; Skip incomplete dynamic blocks. - ((save-excursion - (beginning-of-line) - (looking-at "[ \t]*#\\+BEGIN: ")) - (not (save-excursion - (re-search-forward - "^[ \t]*\\+END:" limit t)))) - ;; Skip incomplete blocks. - ((save-excursion - (beginning-of-line) - (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)")) - (not (save-excursion - (re-search-forward - (concat "^[ \t]*#\\+END_" - (match-string 1)) - limit t)))) - ;; Skip incomplete latex environments. - ((save-excursion - (beginning-of-line) - (looking-at "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}")) - (not (save-excursion - (re-search-forward - (format "^[ \t]*\\\\end{%s}" - (match-string 1)) - limit t)))) - ;; Skip ill-formed keywords. - ((not (save-excursion - (beginning-of-line) - (looking-at "[ \t]*#\\+\\S-+:")))))) - (re-search-forward org-element-paragraph-separate limit 'm)) - (if (eobp) (point) (goto-char (line-beginning-position))))) + (if (not (re-search-forward + org-element-paragraph-separate limit 'm)) + limit + ;; A matching `org-element-paragraph-separate' is not + ;; necessarily the end of the paragraph. In + ;; particular, lines starting with # or : as a first + ;; non-space character are ambiguous. We have check + ;; if they are valid Org syntax (i.e. not an + ;; incomplete keyword). + (beginning-of-line) + (while (not + (or + ;; There's no ambiguity for other symbols or + ;; empty lines: stop here. + (looking-at "[ \t]*\\(?:[^:#]\\|$\\)") + ;; Stop at valid fixed-width areas. + (looking-at "[ \t]*:\\(?: \\|$\\)") + ;; Stop at drawers. + (and (looking-at org-drawer-regexp) + (save-excursion + (re-search-forward + "^[ \t]*:END:[ \t]*$" limit t))) + ;; Stop at valid comments. + (looking-at "[ \t]*#\\(?: \\|$\\)") + ;; Stop at valid dynamic blocks. + (and (looking-at org-dblock-start-re) + (save-excursion + (re-search-forward + "^[ \t]*#\\+END:?[ \t]*$" limit t))) + ;; Stop at valid blocks. + (and (looking-at + "[ \t]*#\\+BEGIN_\\(\\S-+\\)") + (save-excursion + (re-search-forward + (format "^[ \t]*#\\+END_%s[ \t]*$" + (match-string 1)) + limit t))) + ;; Stop at valid latex environments. + (and (looking-at + "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}[ \t]*$") + (save-excursion + (re-search-forward + (format "^[ \t]*\\\\end{%s}[ \t]*$" + (match-string 1)) + limit t))) + ;; Stop at valid keywords. + (looking-at "[ \t]*#\\+\\S-+:") + ;; Skip everything else. + (not + (progn + (end-of-line) + (re-search-forward org-element-paragraph-separate + limit 'm))))) + (beginning-of-line))) + (if (= (point) limit) limit + (goto-char (line-beginning-position))))) (contents-end (progn (skip-chars-backward " \r\t\n" contents-begin) (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'paragraph (nconc (list :begin begin @@ -1837,7 +1873,8 @@ and `:post-blank' keywords." (begin (point)) (post-blank (let ((before-blank (progn (forward-line) (point)))) (skip-chars-forward " \r\t\n" limit) - (unless (eobp) (beginning-of-line)) + (skip-chars-backward " \t") + (unless (bolp) (end-of-line)) (count-lines before-blank (point)))) (end (point)) closed deadline scheduled) @@ -1895,7 +1932,7 @@ Assume point is at the beginning of the property drawer." (hidden (org-invisible-p2)) (properties (let (val) - (while (not (looking-at "^[ \t]*:END:")) + (while (not (looking-at "^[ \t]*:END:[ \t]*$")) (when (looking-at "[ \t]*:\\([A-Za-z][-_A-Za-z0-9]*\\):") (push (cons (org-match-string-no-properties 1) (org-trim @@ -1908,7 +1945,8 @@ Assume point is at the beginning of the property drawer." (point-at-bol))) (pos-before-blank (progn (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'property-drawer (list :begin begin :end end @@ -1974,7 +2012,8 @@ containing `:language', `:switches', `:parameters', `:begin', Assume point is at the beginning of the block." (let ((case-fold-search t)) - (if (not (save-excursion (re-search-forward "^[ \t]*#\\+END_SRC" limit t))) + (if (not (save-excursion (re-search-forward "^[ \t]*#\\+END_SRC[ \t]*$" + limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((contents-end (match-beginning 0))) @@ -2017,13 +2056,15 @@ Assume point is at the beginning of the block." ;; Get visibility status. (hidden (progn (forward-line) (org-invisible-p2))) ;; Retrieve code. - (value (buffer-substring-no-properties (point) contents-end)) + (value (org-unescape-code-in-string + (buffer-substring-no-properties (point) contents-end))) (pos-before-blank (progn (goto-char contents-end) (forward-line) (point))) ;; Get position after ending blank lines. (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'src-block (nconc (list :language language @@ -2051,7 +2092,6 @@ CONTENTS is nil." (params (org-element-property :parameters src-block)) (value (let ((val (org-element-property :value src-block))) (cond - (org-src-preserve-indentation val) ((zerop org-edit-src-content-indentation) (org-remove-indentation val)) @@ -2065,7 +2105,7 @@ CONTENTS is nil." (concat (and lang (concat " " lang)) (and switches (concat " " switches)) (and params (concat " " params)))) - value + (org-escape-code-in-string value) "#+END_SRC"))) @@ -2087,7 +2127,10 @@ Assume point is at the beginning of the table." (type (if (org-at-table.el-p) 'table.el 'org)) (keywords (org-element--collect-affiliated-keywords)) (begin (car keywords)) - (table-end (goto-char (marker-position (org-table-end t)))) + (table-end + (if (re-search-forward org-table-any-border-regexp limit 'm) + (goto-char (match-beginning 0)) + (point))) (tblfm (let (acc) (while (looking-at "[ \t]*#\\+TBLFM: +\\(.*\\)[ \t]*$") (push (org-match-string-no-properties 1) acc) @@ -2095,7 +2138,8 @@ Assume point is at the beginning of the table." acc)) (pos-before-blank (point)) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'table (nconc (list :begin begin @@ -2179,7 +2223,7 @@ containing `:begin', `:end', `:contents-begin', `:contents-end', Assume point is at beginning of the block." (let ((case-fold-search t)) (if (not (save-excursion - (re-search-forward "^[ \t]*#\\+END_VERSE" limit t))) + (re-search-forward "^[ \t]*#\\+END_VERSE[ \t]*$" limit t))) ;; Incomplete block: parse it as a paragraph. (org-element-paragraph-parser limit) (let ((contents-end (match-beginning 0))) @@ -2192,7 +2236,8 @@ Assume point is at beginning of the block." (forward-line) (point))) (end (progn (skip-chars-forward " \r\t\n" limit) - (if (eobp) (point) (point-at-bol))))) + (skip-chars-backward " \t") + (if (bolp) (point) (line-end-position))))) (list 'verse-block (nconc (list :begin begin @@ -2367,6 +2412,7 @@ LIMIT bounds the search. Return value is a cons cell whose CAR is `entity' or `latex-fragment' and CDR is beginning position." (save-excursion + (unless (bolp) (backward-char)) (let ((matchers (remove "begin" (plist-get org-format-latex-options :matchers))) ;; ENTITY-RE matches both LaTeX commands and Org entities. @@ -3044,6 +3090,7 @@ LIMIT bounds the search. Return value is a cons cell whose CAR is either `subscript' or `superscript' and CDR is beginning position." (save-excursion + (unless (bolp) (backward-char)) (when (re-search-forward org-match-substring-regexp limit t) (cons (if (string= (match-string 2) "_") 'subscript 'superscript) (match-beginning 2))))) @@ -3838,6 +3885,15 @@ Return value is an alist whose CAR is position and CDR the object type, as a symbol. OBJECTS is the previous candidates alist." + ;; Filter out any object found but not belonging to RESTRICTION. + (setq objects + (org-remove-if-not + (lambda (obj) + (let ((type (car obj))) + (memq (or (cdr (assq type org-element-object-successor-alist)) + type) + restriction))) + objects)) (let (next-candidates types-to-search) ;; If no previous result, search every object type in RESTRICTION. ;; Otherwise, keep potential candidates (old objects located after @@ -4235,7 +4291,7 @@ and :post-blank properties." (progn (beginning-of-line) (skip-chars-forward "* ") (setq end (point-at-eol)))) - (and (memq type '(paragraph table-cell verse-block)) + (and (memq type '(paragraph table-row verse-block)) (let ((cbeg (org-element-property :contents-begin element)) (cend (org-element-property @@ -4254,7 +4310,7 @@ and :post-blank properties." candidates))) ;; If ORIGIN is before next object in element, there's ;; no point in looking further. - (if (> (cdr closest-cand) origin) (throw 'exit element) + (if (> (cdr closest-cand) origin) (throw 'exit parent) (let* ((object (progn (goto-char (cdr closest-cand)) (funcall (intern (format "org-element-%s-parser" @@ -4274,7 +4330,9 @@ and :post-blank properties." ;; search to the end of its contents. (t (goto-char cbeg) (org-element-put-property object :parent parent) - (setq parent object end cend))))))) + (setq parent object + restriction (org-element-restriction object) + end cend))))))) parent)))))) (defsubst org-element-nested-p (elem-A elem-B) @@ -4351,6 +4409,10 @@ end of ELEM-A." (cdr overlays))) (goto-char (org-element-property :end elem-B))))) - (provide 'org-element) + +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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 @@ (declare-function org-table-colgroup-line-p "org-table" (line)) (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label)) +(declare-function org-unescape-code-in-region "org-src" (beg end)) (autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t) @@ -1790,7 +1791,7 @@ from the buffer." beg-content end-content `(org-protected t original-indentation ,ind org-native-text t)) ;; strip protective commas - (org-strip-protective-commas beg-content end-content) + (org-unescape-code-in-region beg-content end-content) (delete-region (match-beginning 0) (match-end 0)) (save-excursion (goto-char beg) @@ -3230,7 +3231,6 @@ Does include HTML export options as well as TODO and CATEGORY stuff." org-archive-location "org file:~/org/%s.org")) -;;;###autoload (defun org-insert-export-options-template () "Insert into the buffer a template with information for exporting." (interactive) @@ -3348,4 +3348,8 @@ The depends on the variable `org-export-copy-to-kill-ring'." (provide 'org-exp) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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)." :group 'org-faces) (defface org-agenda-filter-tags - (org-compatible-face 'modeline + (org-compatible-face 'mode-line nil) "Face for tag(s) in the mode-line when filtering the agenda." :group 'org-faces) (defface org-agenda-filter-category - (org-compatible-face 'modeline + (org-compatible-face 'mode-line nil) "Face for tag(s) in the mode-line when filtering the agenda." :group 'org-faces) @@ -770,9 +770,9 @@ level org-n-level-faces" "Face used to highlight math latex and other special exporter stuff." :group 'org-faces) -(org-copy-face 'modeline 'org-mode-line-clock +(org-copy-face 'mode-line 'org-mode-line-clock "Face used for clock display in mode line.") -(org-copy-face 'modeline 'org-mode-line-clock-overrun +(org-copy-face 'mode-line 'org-mode-line-clock-overrun "Face used for clock display for overrun tasks in mode line." :background "red") 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." (provide 'org-feed) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (provide 'org-footnote) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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 (provide 'org-freemind) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: ;;; 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 your own style information." :group 'org-export-html :type 'boolean) + ;;;###autoload (put 'org-export-html-style-include-default 'safe-local-variable 'booleanp) @@ -2380,7 +2381,6 @@ the settings define in the org-... variables." (plist-get htmlize-buffer-places 'content-end))) (kill-buffer htmlbuf)))) -;;;###autoload (defun org-export-htmlize-generate-css () "Create the CSS for all font definitions in the current Emacs session. Use this to create face definitions in your CSS style file that can then @@ -2749,4 +2749,8 @@ the alist of previous items." (provide 'org-html) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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)." (provide 'org-icalendar) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (org-entry-put (point) "ID" nil)) (org-id-get (point) 'create)) -;;;###autoload (defun org-id-copy () "Copy the ID of the entry at point to the kill ring. Create an ID if necessary." @@ -259,7 +258,6 @@ In any case, the ID of the entry is returned." (org-id-add-location id (buffer-file-name (buffer-base-buffer))) id))))) -;;;###autoload (defun org-id-get-with-outline-path-completion (&optional targets) "Use outline-path-completion to retrieve the ID of an entry. 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." (prog1 (org-id-get pom 'create) (move-marker pom nil)))) -;;;###autoload (defun org-id-get-with-outline-drilling (&optional targets) "Use an outline-cycling interface to retrieve the ID of an entry. 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." (provide 'org-id) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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'." (provide 'org-indent) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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 @@ -;;; org-install.el --- Outline-based notes management and organizer -;; Carstens outline-mode for keeping track of everything. -;; Copyright (C) 2004-2012 Free Software Foundation, Inc. +;;; org-install.el --- autogenerated file, do not edit ;; -;; Author: Carsten Dominik -;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org -;; Version: 6.06b -;; -;; This file is part of GNU Emacs. -;; -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: -;; -;; When Org-mode is distributed with Emacs, this is just a dummy file. -;; In an Org-mode distribution outside Emacs, this file would provide -;; the autoloads. We include this dummy version in Emacs, so that people -;; can leave a (require 'org-install) in .emacs, independently of -;; which kind of distribution they use. -;; - +;;; Code: +(warn "The file org-install is obsolete. +Please change your configuration to (require 'org) instead.") + (provide 'org-install) - + +;; Local Variables: +;; no-byte-compile: t +;; coding: utf-8 +;; End: ;;; 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." (provide 'org-irc) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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 --load=$HOME/lib/emacs/org.el --eval \"(setq org-export-headline-levels 2)\" --visit=MyFile --funcall org-export-as-latex-batch" - (org-export-as-latex org-export-headline-levels 'hidden)) + (org-export-as-latex org-export-headline-levels)) ;;;###autoload (defun org-export-as-latex-to-buffer (arg) "Call `org-export-as-latex` with output to a temporary buffer. No file is created. The prefix ARG is passed through to `org-export-as-latex'." (interactive "P") - (org-export-as-latex arg nil nil "*Org LaTeX Export*") + (org-export-as-latex arg nil "*Org LaTeX Export*") (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window "*Org LaTeX Export*"))) @@ -848,7 +848,7 @@ in a window. A non-interactive call will only return the buffer." (set-mark (point)) ;; to activate the region (goto-char beg) (setq rtn (org-export-as-latex - nil nil ext-plist + nil ext-plist buffer body-only)) (if (fboundp 'deactivate-mark) (deactivate-mark)) (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." rtn))) ;;;###autoload -(defun org-export-as-latex (arg &optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-latex (arg &optional ext-plist to-buffer body-only pub-dir) "Export current buffer to a LaTeX file. If there is an active region, export only the region. The prefix ARG specifies how many levels of the outline should become headlines. The default is 3. Lower levels will be exported depending on `org-export-latex-low-levels'. The default is to convert them as description lists. -HIDDEN is obsolete and does nothing. -EXT-PLIST is a property list with -external parameters overriding org-mode's default settings, but -still inferior to file-local settings. When TO-BUFFER is -non-nil, create a buffer with that name and export to that -buffer. If TO-BUFFER is the symbol `string', don't leave any -buffer behind but just return the resulting LaTeX as a string. +EXT-PLIST is a property list with external parameters overriding +org-mode's default settings, but still inferior to file-local settings. +When TO-BUFFER is non-nil, create a buffer with that name and export +to that buffer. If TO-BUFFER is the symbol `string', don't leave any +buffer behind and just return the resulting LaTeX as a string, with +no LaTeX header. When BODY-ONLY is set, don't produce the file header and footer, simply return the content of \\begin{document}...\\end{document}, without even the \\begin{document} and \\end{document} commands. @@ -957,10 +955,9 @@ when PUB-DIR is set, use this as the publishing directory." (auto-insert nil); Avoid any auto-insert stuff for the new file (TeX-master (boundp 'TeX-master)) (buffer (if to-buffer - (cond - ((eq to-buffer 'string) (get-buffer-create - "*Org LaTeX Export*")) - (t (get-buffer-create to-buffer))) + (if (eq to-buffer 'string) + (get-buffer-create "*Org LaTeX Export*") + (get-buffer-create to-buffer)) (find-file-noselect filename))) (odd org-odd-levels-only) (header (org-export-latex-make-header title opt-plist)) @@ -1120,8 +1117,7 @@ when PUB-DIR is set, use this as the publishing directory." (interactive "P") (message "Exporting to PDF...") (let* ((wconfig (current-window-configuration)) - (lbuf (org-export-as-latex arg hidden ext-plist - to-buffer body-only pub-dir)) + (lbuf (org-export-as-latex arg ext-plist to-buffer body-only pub-dir)) (file (buffer-file-name lbuf)) (base (file-name-sans-extension (buffer-file-name lbuf))) (pdffile (concat base ".pdf")) @@ -2899,4 +2895,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (provide 'org-export-latex) (provide 'org-latex) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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 @@ (require 'org-list) (require 'format-spec) -;;;###autoload (defun org-lparse-and-open (target-backend native-backend arg &optional file-or-buf) "Export outline to TARGET-BACKEND via NATIVE-BACKEND and open exported file. @@ -71,7 +70,6 @@ lists." (when org-export-kill-product-buffer-when-displayed (kill-buffer (current-buffer)))))) -;;;###autoload (defun org-lparse-batch (target-backend &optional native-backend) "Call the function `org-lparse'. This function can be used in batch processing as: @@ -83,7 +81,6 @@ emacs --batch (org-lparse target-backend native-backend org-export-headline-levels 'hidden)) -;;;###autoload (defun org-lparse-to-buffer (backend arg) "Call `org-lparse' with output to a temporary buffer. 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 (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window tempbuf)))) -;;;###autoload (defun org-replace-region-by (backend beg end) "Assume the current region has org-mode syntax, and convert it to HTML. This can be used in any buffer. For example, you could write an @@ -115,7 +111,6 @@ this command to convert it." (delete-region beg end) (insert backend-string))) -;;;###autoload (defun org-lparse-region (backend beg end &optional body-only buffer) "Convert region from BEG to END in org-mode buffer to HTML. If prefix arg BODY-ONLY is set, omit file header, footer, and table of @@ -447,11 +442,12 @@ PUB-DIR specifies the publishing directory." (error "Don't know how to export to backend %s %s" target-backend (format "via %s" native-backend))) (run-hooks 'org-export-first-hook) - (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir) - (remove-hook 'org-export-preprocess-hook - 'org-lparse-strip-experimental-blocks-maybe) - (remove-hook 'org-export-preprocess-after-blockquote-hook - 'org-lparse-preprocess-after-blockquote))) + (prog1 + (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir) + (remove-hook 'org-export-preprocess-hook + 'org-lparse-strip-experimental-blocks-maybe) + (remove-hook 'org-export-preprocess-after-blockquote-hook + 'org-lparse-preprocess-after-blockquote)))) (defcustom org-lparse-use-flashy-warning nil "Control flashing of messages logged with `org-lparse-warn'. @@ -480,6 +476,8 @@ This is a helper routine for interactive use." (eval-when-compile (require 'browse-url)) +(declare-function browse-url-file-url "browse-url" (file)) + (defun org-lparse-do-convert (in-file out-fmt &optional prefix-arg) "Workhorse routine for `org-export-odt-convert'." (require 'browse-url) @@ -2298,4 +2296,8 @@ Replaces invalid characters with \"_\"." (provide 'org-lparse) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (let ((table '(?: ?/))) (org-link-escape s table))) -;;;###autoload (defun org-mobile-create-sumo-agenda () "Create a file that contains all custom agenda views." (interactive) @@ -1129,4 +1128,8 @@ A and B must be strings or nil." (provide 'org-mobile) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (defun org-export-odt-preprocess (parameters) (org-export-odt-preprocess-label-references)) -(declare-function archive-zip-extract "arc-mode.el" (archive name)) +(declare-function archive-zip-extract "arc-mode" (archive name)) (defun org-odt-zip-extract-one (archive member &optional target) (require 'arc-mode) (let* ((target (or target default-directory)) @@ -2847,4 +2847,8 @@ formula file." (provide 'org-odt) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (provide 'org-plot) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (if force nil org-publish-use-timestamps-flag))) (org-publish-projects org-publish-project-alist)))) - ;;;###autoload (defun org-publish-current-file (&optional force) "Publish the current file. @@ -1192,4 +1191,8 @@ Returns value on success, else nil." (provide 'org-publish) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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'." (provide 'org-remember) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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 @@ (declare-function org-at-table.el-p "org" ()) (declare-function org-get-indentation "org" (&optional line)) (declare-function org-switch-to-buffer-other-window "org" (&rest args)) -(declare-function org-strip-protective-commas "org" (beg end)) (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label)) -(declare-function org-strip-protective-commas "org" (beg end)) (declare-function org-base-buffer "org" (buffer)) (defcustom org-edit-src-region-extra nil @@ -311,13 +309,8 @@ buffer." (error "Language mode `%s' fails with: %S" lang-f (nth 1 e))))) (dolist (pair transmitted-variables) (org-set-local (car pair) (cadr pair))) - (if (derived-mode-p 'org-mode) - (progn - (goto-char (point-min)) - (while (re-search-forward "^," nil t) - (if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent))) - (replace-match ""))) - (org-strip-protective-commas (point-min) (point-max))) + ;; Remove protecting commas from visible part of buffer. + (org-unescape-code-in-region (point-min) (point-max)) (when markline (org-goto-line (1+ (- markline begline))) (org-move-to-column @@ -590,20 +583,38 @@ the language, a switch telling if the content should be in a single line." (goto-char pos) (org-get-indentation))) -(defun org-add-protective-commas (beg end &optional line) - "Add protective commas in region. -Return the delta in size of the region." +(defun org-escape-code-in-region (beg end) + "Escape lines between BEG and END. +Escaping happens when a line starts with \"*\", \"#+\", \",*\" or +\",#+\" by appending a comma to it." (interactive "r") - (let ((org-re "^\\(.\\)") - (other-re "^\\([*]\\|[ \t]*#\\+\\)") - (delta 0)) - (save-excursion - (goto-char beg) - (while (re-search-forward (if (derived-mode-p 'org-mode) org-re other-re) - end t) - (if (and line (eq (org-current-line) line)) (setq delta (1+ delta))) - (replace-match ",\\1"))) - delta)) + (save-excursion + (goto-char beg) + (while (re-search-forward "^[ \t]*,?\\(\\*\\|#\\+\\)" end t) + (replace-match ",\\1" nil nil nil 1)))) + +(defun org-escape-code-in-string (s) + "Escape lines in string S. +Escaping happens when a line starts with \"*\", \"#+\", \",*\" or +\",#+\" by appending a comma to it." + (replace-regexp-in-string "^[ \t]*,?\\(\\*\\|#\\+\\)" ",\\1" s nil nil 1)) + +(defun org-unescape-code-in-region (beg end) + "Un-escape lines between BEG and END. +Un-escaping happens by removing the first comma on lines starting +with \",*\", \",#+\", \",,*\" and \",,#+\"." + (interactive "r") + (save-excursion + (goto-char beg) + (while (re-search-forward "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" end t) + (replace-match "" nil nil nil 1)))) + +(defun org-unescape-code-in-string (s) + "Un-escape lines in string S. +Un-escaping happens by removing the first comma on lines starting +with \",*\", \",#+\", \",,*\" and \",,#+\"." + (replace-regexp-in-string + "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" "" s nil nil 1)) (defun org-edit-src-exit (&optional context) "Exit special edit and protect problematic lines." @@ -649,8 +660,12 @@ Return the delta in size of the region." (goto-char (point-min)) (if (looking-at "\\s-*") (replace-match " "))) (when (org-bound-and-true-p org-edit-src-from-org-mode) - (setq delta (+ delta (org-add-protective-commas - (point-min) (point-max) line)))) + (org-escape-code-in-region (point-min) (point-max)) + (setq delta (+ delta + (save-excursion + (org-goto-line line) + (if (looking-at "[ \t]*\\(,,\\)?\\(\\*\\|#+\\)") 1 + 0))))) (when (org-bound-and-true-p org-edit-src-picture) (setq preserve-indentation nil) (untabify (point-min) (point-max)) @@ -674,9 +689,10 @@ Return the delta in size of the region." (kill-buffer buffer)) (goto-char beg) (when allow-write-back-p - (delete-region beg (1- end)) - (insert code) - (delete-char 1) + (delete-region beg (max beg (1- end))) + (unless (string-match "^[ \t]*$" code) + (insert code) + (delete-char 1)) (goto-char beg) (if single (just-one-space))) (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." (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)") "Match a reference that needs translation, for reference display.") +;;;###autoload (defun org-table-create-with-table.el () "Use the table.el package to insert a new table. If there is already a table at point, convert between Org-mode tables @@ -439,6 +440,7 @@ and table.el tables." (org-table-convert))) (t (call-interactively 'table-insert)))) +;;;###autoload (defun org-table-create-or-convert-from-region (arg) "Convert region to table, or create an empty table. 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'." (org-table-convert-region (region-beginning) (region-end) arg) (org-table-create arg))) +;;;###autoload (defun org-table-create (&optional size) "Query for a size and insert a table skeleton. 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\"." (goto-char pos))) (org-table-align))) +;;;###autoload (defun org-table-convert-region (beg0 end0 &optional separator) "Convert region to a table. 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 (goto-char beg) (org-table-align))) +;;;###autoload (defun org-table-import (file arg) "Import FILE as a table. 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." (defvar org-table-last-alignment) (defvar org-table-last-column-widths) +;;;###autoload (defun org-table-export (&optional file format) "Export table to a file, with configurable format. Such a file can be imported into usual spreadsheet programs. @@ -673,6 +679,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.") (defconst org-narrow-column-arrow "=>" "Used as display property in narrowed table columns.") +;;;###autoload (defun org-table-align () "Align the table at point by aligning all vertical bars." (interactive) @@ -884,6 +891,7 @@ With argument TABLE-TYPE, go to the end of a table.el-type table." (goto-char (match-beginning 0))) (point-marker))) +;;;###autoload (defun org-table-justify-field-maybe (&optional new) "Justify the current field, text to left, number to right. 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." (setq org-table-may-need-update t)) (goto-char pos)))))) +;;;###autoload (defun org-table-next-field () "Go to the next field in the current table, creating new lines as needed. Before doing so, re-align the table if necessary." @@ -953,6 +962,7 @@ Before doing so, re-align the table if necessary." (error (org-table-insert-row 'below))))) +;;;###autoload (defun org-table-previous-field () "Go to the previous field in the table. Before doing so, re-align the table if necessary." @@ -1006,6 +1016,7 @@ With numeric argument N, move N-1 fields backward first." (forward-char 1))) (if (<= (point) pos) (org-table-end-of-field 2)))) +;;;###autoload (defun org-table-next-row () "Go to the next row (same column) in the current table. Before doing so, re-align the table if necessary." @@ -1029,6 +1040,7 @@ Before doing so, re-align the table if necessary." (skip-chars-backward "^|\n\r") (if (looking-at " ") (forward-char 1))))) +;;;###autoload (defun org-table-copy-down (n) "Copy a field down in the current column. If the field at the cursor is empty, copy into it the content of @@ -1173,6 +1185,7 @@ is always the old value." val) (forward-char 1) "")) +;;;###autoload (defun org-table-field-info (arg) "Show info about the current field, and highlight any reference at point." (interactive "P") @@ -1228,6 +1241,7 @@ is always the old value." (message "In table column %d" cnt)) cnt))) +;;;###autoload (defun org-table-current-dline () "Find out what table data line we are in. Only data lines count for this." @@ -1244,6 +1258,7 @@ Only data lines count for this." (message "This is table line %d" cnt)) cnt))) +;;;###autoload (defun org-table-goto-column (n &optional on-delim force) "Move the cursor to the Nth column in the current table line. 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." (backward-char 1) (if (looking-at " ") (forward-char 1))))) +;;;###autoload (defun org-table-insert-column () "Insert a new column into the table." (interactive) @@ -1335,6 +1351,7 @@ first dline below it is used. When ABOVE is non-nil, the one above is used." (setq i (1+ i))))) nil)) +;;;###autoload (defun org-table-delete-column () "Delete a column from the table." (interactive) @@ -1367,15 +1384,18 @@ first dline below it is used. When ABOVE is non-nil, the one above is used." (org-table-fix-formulas "$LR" (list (cons (number-to-string col) "INVALID")) col -1 col)))) +;;;###autoload (defun org-table-move-column-right () "Move column to the right." (interactive) (org-table-move-column nil)) +;;;###autoload (defun org-table-move-column-left () "Move column to the left." (interactive) (org-table-move-column 'left)) +;;;###autoload (defun org-table-move-column (&optional left) "Move the current column to the right. With arg LEFT, move to the left." (interactive "P") @@ -1415,15 +1435,18 @@ first dline below it is used. When ABOVE is non-nil, the one above is used." "$LR" (list (cons (number-to-string col) (number-to-string colpos)) (cons (number-to-string colpos) (number-to-string col))))))) +;;;###autoload (defun org-table-move-row-down () "Move table row down." (interactive) (org-table-move-row nil)) +;;;###autoload (defun org-table-move-row-up () "Move table row up." (interactive) (org-table-move-row 'up)) +;;;###autoload (defun org-table-move-row (&optional up) "Move the current table line down. With arg UP, move it up." (interactive "P") @@ -1457,6 +1480,7 @@ first dline below it is used. When ABOVE is non-nil, the one above is used." "@" (list (cons (number-to-string dline1) (number-to-string dline2)) (cons (number-to-string dline2) (number-to-string dline1))))))) +;;;###autoload (defun org-table-insert-row (&optional arg) "Insert a new row above the current line into the table. With prefix ARG, insert below the current line." @@ -1478,6 +1502,7 @@ With prefix ARG, insert below the current line." (funcall org-table-fix-formulas-confirm "Fix formulas? ")) (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))) +;;;###autoload (defun org-table-insert-hline (&optional above) "Insert a horizontal-line below the current line into the table. With prefix ABOVE, insert above the current line." @@ -1501,6 +1526,7 @@ With prefix ABOVE, insert above the current line." (org-move-to-column col) (and org-table-overlay-coordinates (org-table-align)))) +;;;###autoload (defun org-table-hline-and-move (&optional same-column) "Insert a hline and move to the row below that line." (interactive "P") @@ -1527,6 +1553,7 @@ In particular, this does handle wide and invisible characters." t t s))) s)) +;;;###autoload (defun org-table-kill-row () "Delete the current row or horizontal line from the table." (interactive) @@ -1542,6 +1569,7 @@ In particular, this does handle wide and invisible characters." (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID")) dline -1 dline)))) +;;;###autoload (defun org-table-sort-lines (with-case &optional sorting-type) "Sort table lines according to the column at point. @@ -1622,7 +1650,7 @@ should be done in reverse order." (org-table-goto-column thiscol) (message "%d lines sorted, based on column %d" (length lns) column))) - +;;;###autoload (defun org-table-cut-region (beg end) "Copy region in table to the clipboard and blank all relevant fields. 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." (if (org-region-active-p) (region-end) (point)))) (org-table-copy-region beg end 'cut)) +;;;###autoload (defun org-table-copy-region (beg end &optional cut) "Copy rectangular region in table to clipboard. A special clipboard is used which can only be accessed @@ -1668,6 +1697,7 @@ with `org-table-paste-rectangle'." (if cut (org-table-align)) org-table-clip)) +;;;###autoload (defun org-table-paste-rectangle () "Paste a rectangular region into a table. The upper right corner ends up in the current field. All involved fields @@ -1698,6 +1728,7 @@ lines." (org-table-goto-column col) (org-table-align))) +;;;###autoload (defun org-table-convert () "Convert from `org-mode' table to table.el and back. Obviously, this only works within limits. When an Org-mode table is @@ -1771,6 +1802,7 @@ Note that horizontal lines disappeared." contents "")) (org-table-align))) +;;;###autoload (defun org-table-wrap-region (arg) "Wrap several fields in a column like a paragraph. 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." (defvar org-field-marker nil) +;;;###autoload (defun org-table-edit-field (arg) "Edit table field in a different window. 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')." (defvar org-timecnt) ; dynamically scoped parameter +;;;###autoload (defun org-table-sum (&optional beg end nlast) "Sum numbers in region of current table column. 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." (bs (org-table-formula-make-cmp-string (car b)))) (and as bs (string< as bs)))) +;;;###autoload (defun org-table-get-stored-formulas (&optional noerror) "Return an alist with the stored formulas directly after current table." - (interactive) + (interactive) ;; FIXME interactive? (let ((case-fold-search t) scol eq eq-alist strings string seen) (save-excursion (goto-char (org-table-end)) @@ -2283,6 +2318,7 @@ For all numbers larger than LIMIT, shift them by DELTA." (setq org-table-local-parameters (append org-table-local-parameters al2)))))) +;;;###autoload (defun org-table-maybe-eval-formula () "Check if the current field starts with \"=\" or \":=\". If yes, store the formula and apply it." @@ -2313,6 +2349,7 @@ Will be filled automatically during use.") ("_" . "Names for values in row below this one.") ("^" . "Names for values in row above this one."))) +;;;###autoload (defun org-table-rotate-recalc-marks (&optional newchar) "Rotate the recalculation mark in the first column. If in any row, the first field is not consistent with a mark, @@ -2374,6 +2411,7 @@ of the new mark." (and (org-called-interactively-p 'interactive) (message "%s" (cdr (assoc new org-recalc-marks)))))) +;;;###autoload (defun org-table-maybe-recalculate-line () "Recompute the current line if marked for it, and if we haven't just done it." (interactive) @@ -2397,6 +2435,7 @@ of the new mark." (cons var (cons value org-tbl-calc-modes))) org-tbl-calc-modes) +;;;###autoload (defun org-table-eval-formula (&optional arg equation suppress-align suppress-const suppress-store suppress-analysis) @@ -2823,6 +2862,7 @@ LISPP means to return something appropriate for a Lisp list." elements ",") "]")))) +;;;###autoload (defun org-table-recalculate (&optional all noalign) "Recalculate the current table line by applying all stored formulas. 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." (or noalign (and org-table-may-need-update (org-table-align)) (and all (message "Re-applying formulas...done")))))) +;;;###autoload (defun org-table-iterate (&optional arg) "Recalculate the table until it does not change anymore. The maximum number of iterations is 10, but you can choose a different value @@ -2997,10 +3038,9 @@ with the prefix ARG." "Iterate all tables in the buffer, to converge inter-table dependencies." (interactive) (let* ((imax 10) + (i imax) (checksum (md5 (buffer-string))) - - c1 - (i imax)) + c1) (save-excursion (save-restriction (widen) @@ -3164,6 +3204,7 @@ Parameters get priority." (defvar org-pos) +;;;###autoload (defun org-table-edit-formulas () "Edit the formulas of the current table in a separate buffer." (interactive) @@ -3801,6 +3842,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line." (org-overlay-display ov str 'org-special-keyword 'evaporate))) (beginning-of-line 2))))) +;;;###autoload (defun org-table-toggle-coordinate-overlays () "Toggle the display of Row/Column numbers in tables." (interactive) @@ -3813,6 +3855,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line." (mapc 'delete-overlay org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil))) +;;;###autoload (defun org-table-toggle-formula-debugger () "Toggle the formula debugger in tables." (interactive) @@ -3852,11 +3895,6 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line." (defvar orgtbl-mode-map (make-keymap) "Keymap for `orgtbl-mode'.") -;;;###autoload -(defun turn-on-orgtbl () - "Unconditionally turn on `orgtbl-mode'." - (orgtbl-mode 1)) - (defvar org-old-auto-fill-inhibit-regexp nil "Local variable used by `orgtbl-mode'.") @@ -4480,6 +4518,7 @@ First element has index 0, or I0 if given." (*orgtbl-lfmt* *orgtbl-llfmt*)) (orgtbl-format-line prevline)))))) +;;;###autoload (defun orgtbl-to-generic (table params) "Convert the orgtbl-mode TABLE to some other format. This generic routine can be used for many standard cases. @@ -4606,9 +4645,11 @@ directly by `orgtbl-send-table'. See manual." (remq nil *orgtbl-rtn*) *orgtbl-rtn*)) "\n"))) +;;;###autoload (defun orgtbl-to-tsv (table params) "Convert the orgtbl-mode table to TAB separated material." (orgtbl-to-generic table (org-combine-plists '(:sep "\t") params))) +;;;###autoload (defun orgtbl-to-csv (table params) "Convert the orgtbl-mode table to CSV material. 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." '(:sep "," :fmt org-quote-csv-field) params))) +;;;###autoload (defun orgtbl-to-latex (table params) "Convert the orgtbl-mode TABLE to LaTeX. TABLE is a list, each entry either the symbol `hline' for a horizontal @@ -4654,6 +4696,7 @@ this function is called." :efmt "%s\\,(%s)" :hline "\\hline"))) (orgtbl-to-generic table (org-combine-plists params2 params)))) +;;;###autoload (defun orgtbl-to-html (table params) "Convert the orgtbl-mode TABLE to HTML. TABLE is a list, each entry either the symbol `hline' for a horizontal @@ -4684,6 +4727,7 @@ so you cannot specify parameters for it." (setq html (replace-match "" t t html))) html)) +;;;###autoload (defun orgtbl-to-texinfo (table params) "Convert the orgtbl-mode TABLE to TeXInfo. TABLE is a list, each entry either the symbol `hline' for a horizontal @@ -4722,6 +4766,7 @@ this function is called." :hlstart "@headitem "))) (orgtbl-to-generic table (org-combine-plists params2 params)))) +;;;###autoload (defun orgtbl-to-orgtbl (table params) "Convert the orgtbl-mode TABLE into another orgtbl-mode table. Useful when slicing one table into many. The :hline, :sep, @@ -4832,4 +4877,8 @@ list of the fields in the rectangle ." (provide 'org-table) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (provide 'org-taskjuggler) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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." (org-timer-secs-to-hms (or delta 0))) (run-hooks 'org-timer-start-hook)))) -;;;###autoload (defun org-timer-pause-or-continue (&optional stop) "Pause or continue the relative timer. With prefix arg STOP, stop it entirely." @@ -157,7 +156,6 @@ With prefix arg STOP, stop it entirely." (org-timer-set-mode-line 'pause) (message "Timer paused at %s" (org-timer-value-string))))) -;;;###autoload (defun org-timer-stop () "Stop the relative timer." (interactive) @@ -443,4 +441,8 @@ replace any running timer." (provide 'org-timer) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; org-timer.el ends here diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 688947def52..9fcea6725e3 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -11,10 +11,10 @@ (defun org-git-version () "The Git version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-git-version "7.9.2-GNU-Emacs-24-3")) + (let ((org-git-version "release_7.9.2-68-g7a9d34")) org-git-version)) ;;;###autoload -(defconst org-odt-data-dir "/usr/share/emacs/etc/org" +(defvar org-odt-data-dir "/usr/share/emacs/etc/org" "The location of ODT styles.") (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-*" (provide 'org-xoxo) +;; Local variables: +;; generated-autoload-file: "org-loaddefs.el" +;; End: + ;;; 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 @@ (require 'find-func) (require 'format-spec) +(load "org-loaddefs.el" t t) + ;; `org-outline-regexp' ought to be a defconst but is let-binding in ;; some places -- e.g. see the macro org-with-limited-levels. ;; @@ -117,8 +119,23 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-clock-timestamps-down "org-clock" ()) (declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) +(declare-function orgtbl-mode "org-table" (&optional arg)) +(declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time)) +(declare-function org-beamer-mode "org-beamer" ()) +(declare-function org-table-edit-field "org-table" (arg)) +(declare-function org-table-justify-field-maybe "org-table" (&optional new)) +(declare-function org-id-get-create "org-id" (&optional force)) +(declare-function org-id-find-id-file "org-id" (id)) +(declare-function org-tags-view "org-agenda" (&optional todo-only match)) +(declare-function org-agenda-list "org-agenda" (&optional arg start-day span)) +(declare-function org-table-align "org-table" ()) +(declare-function org-table-paste-rectangle "org-table" ()) +(declare-function org-table-maybe-eval-formula "org-table" ()) +(declare-function org-table-maybe-recalculate-line "org-table" ()) + ;; load languages based on value of `org-babel-load-languages' (defvar org-babel-load-languages) + ;;;###autoload (defun org-babel-do-load-languages (sym value) "Load the languages defined in `org-babel-load-languages'." @@ -206,6 +223,7 @@ identifier." ;;; Version (require 'org-compat) (org-check-version) + ;;;###autoload (defun org-version (&optional here full message) "Show the org-mode version in the echo area. @@ -214,7 +232,7 @@ When FULL is non-nil, use a verbose version string. When MESSAGE is non-nil, display a message with the version." (interactive "P") (let* ((org-dir (ignore-errors (org-find-library-dir "org"))) - (org-install-dir (ignore-errors (org-find-library-dir "org-install.el"))) + (org-install-dir (ignore-errors (org-find-library-dir "org-loaddefs.el"))) (org-trash (or (and (fboundp 'org-release) (fboundp 'org-git-version)) (load (concat org-dir "org-version.el") @@ -228,7 +246,7 @@ When MESSAGE is non-nil, display a message with the version." (if (string= org-dir org-install-dir) org-install-dir (concat "mixed installation! " org-install-dir " and " org-dir)) - "org-install.el can not be found!"))) + "org-loaddefs.el can not be found!"))) (_version (if full version org-version))) (if (org-called-interactively-p 'interactive) (if here @@ -3264,13 +3282,6 @@ forth between agenda and calendar." :group 'org-agenda :type 'sexp) -(defcustom org-calendar-agenda-action-key [?k] - "The key to be installed in `calendar-mode-map' for agenda-action. -The command `org-agenda-action' will be bound to this key. The -default is the character `k' because we use the same key in the agenda." - :group 'org-agenda - :type 'sexp) - (defcustom org-calendar-insert-diary-entry-key [?i] "The key to be installed in `calendar-mode-map' for adding diary entries. 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." '(progn (org-defkey calendar-mode-map org-calendar-to-agenda-key 'org-calendar-goto-agenda) - (org-defkey calendar-mode-map org-calendar-agenda-action-key - 'org-agenda-action) (add-hook 'calendar-mode-hook (lambda () (unless (eq org-agenda-diary-file 'diary-file) @@ -3869,30 +3878,13 @@ This works for both table types.") (eval-and-compile (org-autoload "org-table" - '(org-table-align org-table-begin org-table-blank-field - org-table-convert org-table-convert-region org-table-copy-down - org-table-copy-region org-table-create - org-table-create-or-convert-from-region - org-table-create-with-table.el org-table-current-dline - org-table-cut-region org-table-delete-column org-table-edit-field - org-table-edit-formulas org-table-end org-table-eval-formula - org-table-export org-table-field-info - org-table-get-stored-formulas org-table-goto-column - org-table-hline-and-move org-table-import org-table-insert-column - org-table-insert-hline org-table-insert-row org-table-iterate - org-table-justify-field-maybe org-table-kill-row - org-table-maybe-eval-formula org-table-maybe-recalculate-line - org-table-move-column org-table-move-column-left - org-table-move-column-right org-table-move-row - org-table-move-row-down org-table-move-row-up - org-table-next-field org-table-next-row org-table-paste-rectangle - org-table-previous-field org-table-recalculate - org-table-rotate-recalc-marks org-table-sort-lines org-table-sum - org-table-toggle-coordinate-overlays - org-table-toggle-formula-debugger org-table-wrap-region - orgtbl-mode turn-on-orgtbl org-table-to-lisp - orgtbl-to-generic orgtbl-to-tsv orgtbl-to-csv orgtbl-to-latex - orgtbl-to-orgtbl orgtbl-to-html orgtbl-to-texinfo))) + '(org-table-begin org-table-blank-field org-table-end))) + +;;;###autoload +(defun turn-on-orgtbl () + "Unconditionally turn on `orgtbl-mode'." + (require 'org-table) + (orgtbl-mode 1)) (defun org-at-table-p (&optional table-type) "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." (declare-function org-default-export-plist "org-exp") (declare-function org-infile-export-plist "org-exp") (declare-function org-get-current-options "org-exp") -(eval-and-compile - (org-autoload "org-exp" - '(org-export org-export-visible - org-insert-export-options-template - org-table-clean-before-export)) - (org-autoload "org-ascii" - '(org-export-as-ascii org-export-ascii-preprocess - org-export-as-ascii-to-buffer org-replace-region-by-ascii - org-export-region-as-ascii)) - (org-autoload "org-latex" - '(org-export-as-latex-batch org-export-as-latex-to-buffer - org-replace-region-by-latex org-export-region-as-latex - org-export-as-latex org-export-as-pdf - org-export-as-pdf-and-open)) - (org-autoload "org-html" - '(org-export-as-html-and-open - org-export-as-html-batch org-export-as-html-to-buffer - org-replace-region-by-html org-export-region-as-html - org-export-as-html)) - (org-autoload "org-docbook" - '(org-export-as-docbook-batch org-export-as-docbook-to-buffer - org-replace-region-by-docbook org-export-region-as-docbook - org-export-as-docbook-pdf org-export-as-docbook-pdf-and-open - org-export-as-docbook)) - (org-autoload "org-icalendar" - '(org-export-icalendar-this-file - org-export-icalendar-all-agenda-files - org-export-icalendar-combine-agenda-files)) - (org-autoload "org-xoxo" '(org-export-as-xoxo)) - (org-autoload "org-beamer" '(org-beamer-mode org-beamer-sectioning))) ;; Declare and autoload functions from org-agenda.el (eval-and-compile (org-autoload "org-agenda" - '(org-agenda org-agenda-list org-search-view - org-todo-list org-tags-view org-agenda-list-stuck-projects - org-diary org-agenda-to-appt - org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))) + '(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))) -;; Autoload org-remember - -(eval-and-compile - (org-autoload "org-remember" - '(org-remember-insinuate org-remember-annotation - org-remember-apply-template org-remember org-remember-handler))) - -(eval-and-compile - (org-autoload "org-capture" - '(org-capture org-capture-insert-template-here - org-capture-import-remember-templates))) - -;; Autoload org-clock.el - -(declare-function org-clock-save-markers-for-cut-and-paste "org-clock" - (beg end)) +(declare-function org-clock-save-markers-for-cut-and-paste "org-clock" (beg end)) (declare-function org-clock-update-mode-line "org-clock" ()) (declare-function org-resolve-clocks "org-clock" (&optional also-non-dangling-p prompt last-valid)) @@ -4043,55 +3987,9 @@ The return value is actually the clock marker." (marker-buffer org-clock-marker)) (eval-and-compile - (org-autoload - "org-clock" - '(org-clock-in org-clock-out org-clock-cancel - org-clock-goto org-clock-sum org-clock-display - org-clock-remove-overlays org-clock-report - org-clocktable-shift org-dblock-write:clocktable - org-get-clocktable org-resolve-clocks))) - -(defun org-clock-update-time-maybe () - "If this is a CLOCK line, update it and return t. -Otherwise, return nil." - (interactive) - (save-excursion - (beginning-of-line 1) - (skip-chars-forward " \t") - (when (looking-at org-clock-string) - (let ((re (concat "[ \t]*" org-clock-string - " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]" - "\\([ \t]*=>.*\\)?\\)?")) - ts te h m s neg) - (cond - ((not (looking-at re)) - nil) - ((not (match-end 2)) - (when (and (equal (marker-buffer org-clock-marker) (current-buffer)) - (> org-clock-marker (point)) - (<= org-clock-marker (point-at-eol))) - ;; The clock is running here - (setq org-clock-start-time - (apply 'encode-time - (org-parse-time-string (match-string 1)))) - (org-clock-update-mode-line))) - (t - (and (match-end 4) (delete-region (match-beginning 4) (match-end 4))) - (end-of-line 1) - (setq ts (match-string 1) - te (match-string 3)) - (setq s (- (org-float-time - (apply 'encode-time (org-parse-time-string te))) - (org-float-time - (apply 'encode-time (org-parse-time-string ts)))) - neg (< s 0) - s (abs s) - h (floor (/ s 3600)) - s (- s (* 3600 h)) - m (floor (/ s 60)) - s (- s (* 60 s))) - (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m)) - t)))))) + (org-autoload "org-clock" '(org-clock-remove-overlays + org-clock-update-time-maybe + org-clocktable-shift))) (defun org-check-running-clock () "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." (when (org-match-line "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>") (org-clocktable-shift dir n))) -;; Autoload org-timer.el - -(eval-and-compile - (org-autoload - "org-timer" - '(org-timer-start org-timer org-timer-item - org-timer-change-times-in-region - org-timer-set-timer - org-timer-reset-timers - org-timer-show-remaining-time))) - -;; Autoload org-feed.el - -(eval-and-compile - (org-autoload - "org-feed" - '(org-feed-update org-feed-update-all org-feed-goto-inbox))) - - -;; Autoload org-indent.el +;;;###autoload +(defun org-clock-persistence-insinuate () + "Set up hooks for clock persistence." + (require 'org-clock) + (add-hook 'org-mode-hook 'org-clock-load) + (add-hook 'kill-emacs-hook 'org-clock-save)) ;; Define the variable already here, to make sure we have it. (defvar org-indent-mode nil "Non-nil if Org-Indent mode is enabled. Use the command `org-indent-mode' to change this variable.") -(eval-and-compile - (org-autoload - "org-indent" - '(org-indent-mode))) - -;; Autoload org-mobile.el - -(eval-and-compile - (org-autoload - "org-mobile" - '(org-mobile-push org-mobile-pull org-mobile-create-sumo-agenda))) - ;; Autoload archiving code ;; The stuff that is needed for cycling and tags has to be defined here. @@ -4319,10 +4191,7 @@ Otherwise, these types are allowed: (eval-and-compile (org-autoload "org-archive" - '(org-add-archive-files org-archive-subtree - org-archive-to-archive-sibling org-toggle-archive-tag - org-archive-subtree-default - org-archive-subtree-default-with-confirmation))) + '(org-add-archive-files))) ;; Autoload Column View Code @@ -4331,9 +4200,10 @@ Otherwise, these types are allowed: (declare-function org-columns-compute "org-colview" (property)) (org-autoload (if (featurep 'xemacs) "org-colview-xemacs" "org-colview") - '(org-columns-number-to-string org-columns-get-format-and-top-level - org-columns-compute org-agenda-columns org-columns-remove-overlays - org-columns org-insert-columns-dblock org-dblock-write:columnview)) + '(org-columns-number-to-string + org-columns-get-format-and-top-level + org-columns-compute + org-columns-remove-overlays)) ;; Autoload ID code @@ -4342,15 +4212,10 @@ Otherwise, these types are allowed: (declare-function org-id-locations-save "org-id") (defvar org-id-track-globally) (org-autoload "org-id" - '(org-id-get-create org-id-new org-id-copy org-id-get - org-id-get-with-outline-path-completion - org-id-get-with-outline-drilling org-id-store-link - org-id-goto org-id-find org-id-store-link)) - -;; Autoload Plotting Code - -(org-autoload "org-plot" - '(org-plot/gnuplot)) + '(org-id-new + org-id-copy + org-id-get-with-outline-path-completion + org-id-get-with-outline-drilling)) ;;; Variables for pre-computed regular expressions, all buffer local @@ -5096,7 +4961,7 @@ The following commands are available: (lambda (&rest ignore) (org-show-context 'isearch)))) ;; Turn on org-beamer-mode? - (and org-startup-with-beamer-mode (org-beamer-mode 1)) + (and org-startup-with-beamer-mode (org-beamer-mode)) ;; Setup the pcomplete hooks (set (make-local-variable 'pcomplete-command-completion-function) @@ -5569,22 +5434,6 @@ by a #." t) (t nil)))))) -(defun org-strip-protective-commas (beg end) - "Strip protective commas between BEG and END in the current buffer." - (interactive "r") - (save-excursion - (save-match-data - (goto-char beg) - (let ((front-line (save-excursion - (re-search-forward - "[^[:space:]]" end t) - (goto-char (match-beginning 0)) - (current-column)))) - (while (re-search-forward "^[ \t]*\\(,\\)\\([*]\\|#\\)" end t) - (goto-char (match-beginning 1)) - (when (= (current-column) front-line) - (replace-match "" nil nil nil 1))))))) - (defun org-activate-angle-links (limit) "Run through the buffer and add overlays to links." (if (re-search-forward org-angle-link-re limit t) @@ -6188,10 +6037,9 @@ and subscripts." (defvar org-cycle-subtree-status nil) (make-variable-buffer-local 'org-cycle-subtree-status) -;;;###autoload - (defvar org-inlinetask-min-level) +;;;###autoload (defun org-cycle (&optional arg) "TAB-action and visibility cycling for Org-mode. @@ -9205,7 +9053,7 @@ If optional argument MERGE is set, merge TABLE into (defun org-link-unescape (str) "Unhex hexified Unicode strings as returned from the JavaScript function -encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." +encodeURIComponent. E.g. `%C3%B6' is the german o-Umlaut." (unless (and (null str) (string= "" str)) (let ((pos 0) (case-fold-search t) unhexed) (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 `ö'." str) (defun org-link-unescape-compound (hex) - "Unhexify Unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ö'. + "Unhexify Unicode hex-chars. E.g. `%C3%B6' is the German o-Umlaut. Note: this function also decodes single byte encodings like -`%E1' (\"á\") if not followed by another `%[A-F0-9]{2}' group." +`%E1' (a-acute) if not followed by another `%[A-F0-9]{2}' group." (save-match-data (let* ((bytes (cdr (split-string hex "%"))) (ret "") @@ -11028,11 +10876,13 @@ prefix argument (`C-u C-u C-u C-c C-w')." (and org-auto-align-tags (let ((org-loop-over-headlines-in-active-region nil)) (org-set-tags nil t))) - (bookmark-set "org-refile-last-stored") + (with-demoted-errors + (bookmark-set "org-refile-last-stored")) ;; If we are refiling for capture, make sure that the ;; last-capture pointers point here (when (org-bound-and-true-p org-refile-for-capture) - (bookmark-set "org-capture-last-stored-marker") + (with-demoted-errors + (bookmark-set "org-capture-last-stored-marker")) (move-marker org-capture-last-stored-marker (point))) (if (fboundp 'deactivate-mark) (deactivate-mark)) (run-hooks 'org-after-refile-insert-hook)))) @@ -11128,26 +10978,28 @@ this is used for the GOTO interface." (org-refile-new-child parent-target child))) (error "Invalid target location"))))) -(declare-function org-string-nw-p "org-macs.el" (s)) +(declare-function org-string-nw-p "org-macs" (s)) (defun org-refile-check-position (refile-pointer) - "Check if the refile pointer matches the readline to which it points." + "Check if the refile pointer matches the headline to which it points." (let* ((file (nth 1 refile-pointer)) (re (nth 2 refile-pointer)) (pos (nth 3 refile-pointer)) buffer) - (when (org-string-nw-p re) - (setq buffer (if (markerp pos) - (marker-buffer pos) - (or (find-buffer-visiting file) - (find-file-noselect file)))) - (with-current-buffer buffer - (save-excursion - (save-restriction - (widen) - (goto-char pos) - (beginning-of-line 1) - (unless (org-looking-at-p re) - (error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling")))))))) + (if (and (not (markerp pos)) (not file)) + (error "Please save the buffer to a file before refiling") + (when (org-string-nw-p re) + (setq buffer (if (markerp pos) + (marker-buffer pos) + (or (find-buffer-visiting file) + (find-file-noselect file)))) + (with-current-buffer buffer + (save-excursion + (save-restriction + (widen) + (goto-char pos) + (beginning-of-line 1) + (unless (org-looking-at-p re) + (error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling"))))))))) (defun org-refile-new-child (parent-target child) "Use refile target PARENT-TARGET to add new CHILD below it." @@ -11337,7 +11189,6 @@ Error if there is no such block at point." (goto-char pos) (error "Not in a dynamic block")))) -;;;###autoload (defun org-update-all-dblocks () "Update all dynamic blocks in the buffer. This function can be used in a hook." @@ -12821,7 +12672,7 @@ D Show deadlines and scheduled items between a date range." ((equal ans ?D) (call-interactively 'org-check-dates-range)) ((equal ans ?t) - (org-show-todo-tree nil)) + (call-interactively 'org-show-todo-tree)) ((equal ans ?T) (org-show-todo-tree '(4))) ((member ans '(?T ?m)) @@ -14157,7 +14008,6 @@ Returns the new tags string, or nil to not change the current settings." ;;;; The mapping API -;;;###autoload (defun org-map-entries (func &optional match scope &rest skip) "Call FUNC at each headline selected by MATCH in SCOPE. @@ -15656,14 +15506,13 @@ user." ;; Help matching dotted european dates (when (string-match - "^ *\\(3[01]\\|0?[1-9]\\|[12][0-9]\\)\\. ?\\(0?[1-9]\\|1[012]\\)\\. ?\\([1-9][0-9][0-9][0-9]\\)?" ans) - (setq year (if (match-end 3) - (string-to-number (match-string 3 ans)) - (progn (setq kill-year t) - (string-to-number (format-time-string "%Y")))) + "^ *\\(3[01]\\|0?[1-9]\\|[12][0-9]\\)\\. ?\\(0?[1-9]\\|1[012]\\)\\.\\( ?[1-9][0-9]\\{3\\}\\)?" ans) + (setq year (if (match-end 3) (string-to-number (match-string 3 ans)) + (setq kill-year t) + (string-to-number (format-time-string "%Y"))) day (string-to-number (match-string 1 ans)) month (string-to-number (match-string 2 ans)) - ans (replace-match (format "%04d-%02d-%02d\\5" year month day) + ans (replace-match (format "%04d-%02d-%02d" year month day) t nil ans))) ;; 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. When SHOW-ALL is nil, only return the current occurrence of a time stamp." ;; Make the proper lists from the dates (catch 'exit - (let ((a1 '(("d" . day) ("w" . week) ("m" . month) ("y" . year))) + (let ((a1 '(("h" . hour) + ("d" . day) + ("w" . week) + ("m" . month) + ("y" . year))) + (shour (nth 2 (org-parse-time-string start))) dn dw sday cday n1 n2 n0 d m y y1 y2 date1 date2 nmonths nm ny m2) @@ -16331,6 +16185,13 @@ When SHOW-ALL is nil, only return the current occurrence of a time stamp." (error "Invalid change specifier: %s" change)) (if (eq dw 'week) (setq dw 'day dn (* 7 dn))) (cond + ((eq dw 'hour) + (let ((missing-hours + (mod (+ (- (* 24 (- cday sday)) shour) org-extend-today-until) + dn))) + (setq n1 (if (zerop missing-hours) cday + (- cday (1+ (floor (/ missing-hours 24))))) + n2 (+ cday (floor (/ (- dn missing-hours) 24)))))) ((eq dw 'day) (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn)))) n2 (+ n1 dn))) @@ -16993,7 +16854,9 @@ end of the list." (file-alist (mapcar (lambda (x) (cons (file-truename x) x)) (org-agenda-files t))) - (ctf (file-truename buffer-file-name)) + (ctf (file-truename + (or buffer-file-name + (error "Please save the current buffer to a file")))) x had) (setq x (assoc ctf file-alist) had x) @@ -17012,7 +16875,8 @@ These are the files which are being checked for agenda entries. Optional argument FILE means use this file instead of the current." (interactive) (let* ((org-agenda-skip-unavailable-files nil) - (file (or file buffer-file-name)) + (file (or file buffer-file-name + (error "Current buffer does not visit a file"))) (true-file (file-truename file)) (afile (abbreviate-file-name file)) (files (delq nil (mapcar @@ -17034,7 +16898,7 @@ Optional argument FILE means use this file instead of the current." (defun org-check-agenda-file (file) "Make sure FILE exists. If not, ask user what to do." (when (not (file-exists-p file)) - (message "non-existent agenda file %s. [R]emove from list or [A]bort?" + (message "Non-existent agenda file %s. [R]emove from list or [A]bort?" (abbreviate-file-name file)) (let ((r (downcase (read-char-exclusive)))) (cond @@ -18113,7 +17977,6 @@ BEG and END default to the buffer boundaries." (org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree) ;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree) -(org-defkey org-mode-map "\C-c\C-x\C-k" 'org-mark-entry-for-agenda-action) (org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special) (org-defkey org-mode-map "\C-c\C-x\M-w" 'org-copy-special) (org-defkey org-mode-map "\C-c\C-x\C-y" 'org-paste-special) @@ -18801,13 +18664,12 @@ this function returns t, nil otherwise." nil)))) (autoload 'org-element-at-point "org-element") +(autoload 'org-element-type "org-element") (declare-function org-element-at-point "org-element" (&optional keep-trail)) (declare-function org-element-type "org-element" (element)) -(declare-function org-element-context "org-element" ()) (declare-function org-element-contents "org-element" (element)) (declare-function org-element-property "org-element" (property element)) -(declare-function org-element-paragraph-parser "org-element" (limit)) (declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion)) (declare-function org-element-nested-p "org-element" (elem-a elem-b)) (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. ;;;; Documentation -;;;###autoload (defun org-require-autoloaded-modules () (interactive) (mapc 'require @@ -20813,20 +20674,6 @@ returns the current time." (nth 2 date)))))) (or defd (current-time)))) -(defvar org-agenda-action-marker (make-marker) - "Marker pointing to the entry for the next agenda action.") - -(defun org-mark-entry-for-agenda-action () - "Mark the current entry as target of an agenda action. -Agenda actions are actions executed from the agenda with the key `k', -which make use of the date at the cursor." - (interactive) - (move-marker org-agenda-action-marker - (save-excursion (org-back-to-heading t) (point)) - (current-buffer)) - (message - "Entry marked for action; press `k' at desired date in agenda or calendar")) - (defun org-mark-subtree (&optional up) "Mark the current subtree. 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." ;; Check if auto-filling is meaningful. (let ((fc (current-fill-column))) (when (and fc (> (current-column) fc)) - (let ((fill-prefix (org-adaptive-fill-function))) + (let* ((fill-prefix (org-adaptive-fill-function)) + ;; Enforce empty fill prefix, if required. Otherwise, it + ;; will be computed again. + (adaptive-fill-mode (not (equal fill-prefix "")))) (when fill-prefix (do-auto-fill)))))) (defun org-comment-line-break-function (&optional soft) @@ -21475,45 +21325,43 @@ beyond the end of the headline." (defun org-end-of-line (&optional arg) "Go to the end of the line. -If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the -first attempt, and only move to after the tags when the cursor is already -beyond the end of the headline." +If this is a headline, and `org-special-ctrl-a/e' is set, ignore +tags on the first attempt, and only move to after the tags when +the cursor is already beyond the end of the headline." (interactive "P") - (let ((special (if (consp org-special-ctrl-a/e) - (cdr org-special-ctrl-a/e) - org-special-ctrl-a/e))) + (let ((special (if (consp org-special-ctrl-a/e) (cdr org-special-ctrl-a/e) + org-special-ctrl-a/e)) + (type (org-element-type + (save-excursion (beginning-of-line) (org-element-at-point))))) (cond - ((or (not special) arg - (not (or (org-at-heading-p) (org-at-item-p) (org-at-drawer-p)))) + ((or (not special) arg) (call-interactively - (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line) - ((fboundp 'move-end-of-line) 'move-end-of-line) - (t 'end-of-line)))) - ((org-at-heading-p) + (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line))) + ((memq type '(headline inlinetask)) (let ((pos (point))) - (beginning-of-line 1) - (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$")) - (if (eq special t) - (if (or (< pos (match-beginning 1)) - (= pos (match-end 0))) - (goto-char (match-beginning 1)) - (goto-char (match-end 0))) - (if (or (< pos (match-end 0)) (not (eq this-command last-command))) - (goto-char (match-end 0)) - (goto-char (match-beginning 1)))) - (call-interactively (if (fboundp 'move-end-of-line) - 'move-end-of-line - 'end-of-line))))) - ((org-at-drawer-p) - (move-end-of-line 1) - (when (overlays-at (1- (point))) (backward-char 1))) - ;; At an item: Move before any hidden text. - (t (call-interactively - (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line) - ((fboundp 'move-end-of-line) 'move-end-of-line) - (t 'end-of-line))))) - (org-no-warnings - (and (featurep 'xemacs) (setq zmacs-region-stays t))))) + (beginning-of-line 1) + (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$")) + (if (eq special t) + (if (or (< pos (match-beginning 1)) (= pos (match-end 0))) + (goto-char (match-beginning 1)) + (goto-char (match-end 0))) + (if (or (< pos (match-end 0)) + (not (eq this-command last-command))) + (goto-char (match-end 0)) + (goto-char (match-beginning 1)))) + (call-interactively + (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line))))) + ((memq type + '(center-block comment-block drawer dynamic-block example-block + export-block item plain-list property-drawer + quote-block special-block src-block verse-block)) + ;; Never move past the ellipsis. + (or (eolp) (move-end-of-line 1)) + (when (org-invisible-p2) (backward-char))) + (t + (call-interactively + (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line)))) + (org-no-warnings (and (featurep 'xemacs) (setq zmacs-region-stays t))))) (define-key org-mode-map "\C-a" 'org-beginning-of-line) (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." (if (< l level) (setq arg 1))) (setq arg (1- arg))))) -;;;###autoload (defun org-forward-element () "Move forward by one element. 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." (goto-char (org-element-property :end parent)) (goto-char end)))))) -;;;###autoload (defun org-backward-element () "Move backward by one element. 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." ((org-before-first-heading-p) (goto-char (point-min))) (t (org-back-to-heading))))))) -;;;###autoload (defun org-up-element () "Move to upper element." (interactive) @@ -22026,7 +21871,6 @@ Move to the previous element at the same level, when possible." (error "No surrounding element") (org-with-limited-levels (org-back-to-heading))))))) -;;;###autoload (defvar org-element-greater-elements) (defun org-down-element () "Move to inner element." @@ -22043,7 +21887,6 @@ Move to the previous element at the same level, when possible." (error "No content for this element")))) (t (error "No inner element"))))) -;;;###autoload (defun org-drag-element-backward () "Move backward element at point." (interactive) @@ -22060,7 +21903,6 @@ Move to the previous element at the same level, when possible." (goto-char (+ (org-element-property :begin prev-elem) (- pos (org-element-property :begin elem))))))))) -;;;###autoload (defun org-drag-element-forward () "Move forward element at point." (interactive) @@ -22095,7 +21937,6 @@ Move to the previous element at the same level, when possible." (org-element-swap-A-B elem next-elem) (goto-char (+ pos size-next size-blank)))))) -;;;###autoload (defun org-mark-element () "Put point at beginning of this element, mark at end. @@ -22116,7 +21957,6 @@ ones already marked." (push-mark (org-element-property :end element) t t) (goto-char (org-element-property :begin element)))))) -;;;###autoload (defun org-narrow-to-element () "Narrow buffer to current element." (interactive) @@ -22135,7 +21975,6 @@ ones already marked." (org-element-property :begin elem) (org-element-property :end elem)))))) -;;;###autoload (defun org-transpose-element () "Transpose current and previous elements, keeping blank lines between. Point is moved after both elements." @@ -22145,7 +21984,6 @@ Point is moved after both elements." (org-drag-element-backward) (goto-char end))) -;;;###autoload (defun org-unindent-buffer () "Un-indent the visible part of the buffer. Relative indentation (between items, inside blocks, etc.) isn't From 00323fb326b63bed91aadbef861a234f9299cdbc Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 26 Oct 2012 17:27:29 +0200 Subject: [PATCH 045/109] Fix overwritten typos and Org version number. --- doc/misc/org.texi | 6 +++--- lisp/org/org-version.el | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/misc/org.texi b/doc/misc/org.texi index cdaf1174a26..a69dc0fd81f 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -947,7 +947,7 @@ description on Worg}. Installing Info files is system dependent, because of differences in the @file{install-info} program. The Info documentation is installed together with the rest of Org mode. If you don't install Org mode, it is possible to -install the Info documentation seperately (you need to have +install the Info documentation separately (you need to have install-info@footnote{The output from install-info (if any) is system dependent. In particular Debian and its derivatives use two different versions of install-info and you may see the message: @@ -16693,7 +16693,7 @@ on @file{org-element.el} and @file{org-export.el} has been outstanding, and opened the doors for many new ideas and features. @item Jambunathan K -Jambunathan contributed the ODT exporter, definitly a killer feature of +Jambunathan contributed the ODT exporter, definitely a killer feature of Org mode. He also contributed the new HTML exporter, which is another core feature of Org. Here too, I knew I could rely on him to fix bugs in these areas and to patiently explain the users what was the problems and solutions. @@ -16701,7 +16701,7 @@ areas and to patiently explain the users what was the problems and solutions. @item Achim Gratz Achim rewrote the building process of Org, turning some @emph{ad hoc} tools into a flexible and conceptually clean process. He patiently coped with the -many hicups that such a change can create for users. +many hiccups that such a change can create for users. @item Nick Dokos The Org mode mailing list would not be such a nice place without Nick, who diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 9fcea6725e3..564b49a5cea 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-release "7.9.2")) + (let ((org-release "7.9.2+")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-git-version "release_7.9.2-68-g7a9d34")) + (let ((org-git-version "7.9.2+-GNU-Emacs-24-3")) org-git-version)) ;;;###autoload (defvar org-odt-data-dir "/usr/share/emacs/etc/org" From a2be03575f558aa741e40cd96fbe208092c3a1e7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Oct 2012 11:51:42 -0400 Subject: [PATCH 046/109] * lisp/vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol". (diff-refine-hunk): Similarly, handle the "no LF at eol". Fixes: debbugs:12584 --- lisp/ChangeLog | 7 ++++++- lisp/vc/diff-mode.el | 23 ++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 75fbaa13b92..3c1638fd6f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-26 Stefan Monnier + + * vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol". + (diff-refine-hunk): Similarly, handle the "no LF at eol" (bug#12584). + 2012-10-26 Martin Rudalics * mouse.el (mouse-drag-line): Move last form into preceding when @@ -8,7 +13,7 @@ 2012-10-25 David Engster * emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression): - Removed. This feature is already integrated in imenu. + Remove. This feature is already integrated in imenu. * emacs-lisp/eieio-opt.el: Remove require for `button' since it is always loaded. Require `speedbar' unconditionally. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index cdcc7ca4745..bbe31205c0e 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") (let* ((nold (string-to-number (or (match-string 2) "1"))) (nnew (string-to-number (or (match-string 4) "1"))) (endold - (save-excursion - (re-search-forward (if diff-valid-unified-empty-line - "^[- \n]" "^[- ]") + (save-excursion + (re-search-forward (if diff-valid-unified-empty-line + "^[- \n]" "^[- ]") nil t nold) - (line-beginning-position 2))) + (line-beginning-position + ;; Skip potential "\ No newline at end of file". + (if (looking-at ".*\n\\\\") 3 2)))) (endnew ;; The hunk may end with a bunch of "+" lines, so the `end' is ;; then further than computed above. @@ -490,7 +492,9 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html") (re-search-forward (if diff-valid-unified-empty-line "^[+ \n]" "^[+ ]") nil t nnew) - (line-beginning-position 2)))) + (line-beginning-position + ;; Skip potential "\ No newline at end of file". + (if (looking-at ".*\n\\\\") 3 2))))) (setq end (max endold endnew))))) ;; We may have a first evaluation of `end' thanks to the hunk header. (unless end @@ -1972,8 +1976,13 @@ For use in `add-log-current-defun-function'." (goto-char beg) (pcase style (`unified - (while (re-search-forward "^\\(?:-.*\n\\)+\\(\\)\\(?:\\+.*\n\\)+" - end t) + (while (re-search-forward + (eval-when-compile + (let ((no-LF-at-eol-re "\\(?:\\\\.*\n\\)?")) + (concat "^\\(?:-.*\n\\)+" no-LF-at-eol-re + "\\(\\)" + "\\(?:\\+.*\n\\)+" no-LF-at-eol-re))) + end t) (smerge-refine-subst (match-beginning 0) (match-end 1) (match-end 1) (match-end 0) nil 'diff-refine-preproc props-r props-a))) From 63314e573028a6b8b75566b05193e34117221d03 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Oct 2012 11:59:40 -0400 Subject: [PATCH 047/109] * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Obey byte-compile-warning-enabled-p. Fixes: debbugs:12486 --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/macroexp.el | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3c1638fd6f8..3473dbf6233 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-26 Stefan Monnier + * emacs-lisp/macroexp.el (macroexp--expand-all): + Obey byte-compile-warning-enabled-p (bug#12486). + * vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol". (diff-refine-hunk): Similarly, handle the "no LF at eol" (bug#12584). 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'." (if (and (not (eq form new-form)) ;It was a macro call. (car-safe form) (symbolp (car form)) - (get (car form) 'byte-obsolete-info)) + (get (car form) 'byte-obsolete-info) + (or (not (fboundp 'byte-compile-warning-enabled-p)) + (byte-compile-warning-enabled-p 'obsolete))) (let* ((fun (car form)) (obsolete (get fun 'byte-obsolete-info))) (macroexp--warn-and-return - (macroexp--obsolete-warning fun obsolete "macro") + (macroexp--obsolete-warning + fun obsolete + (if (symbolp (symbol-function fun)) + "alias" "macro")) new-form)) new-form))) (pcase form From c577256946cde9d0558a4395cc15cf6a0119adce Mon Sep 17 00:00:00 2001 From: Bastien Date: Fri, 26 Oct 2012 13:07:35 -0400 Subject: [PATCH 048/109] * lisp/face-remap.el: Use lexical-binding. (text-scale-adjust): Improve docstring. Use itself for the temporary overlay-map bindings, so as to repeat the "Use..." message each time. --- lisp/ChangeLog | 7 +++++++ lisp/face-remap.el | 33 ++++++++++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3473dbf6233..bda9ac0d4aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-10-26 Bastien + Stefan Monnier + + * face-remap.el: Use lexical-binding. + (text-scale-adjust): Improve docstring. Use itself for the temporary + overlay-map bindings, so as to repeat the "Use..." message each time. + 2012-10-26 Stefan Monnier * emacs-lisp/macroexp.el (macroexp--expand-all): diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 09503d7c154..baf1eeb389d 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -1,4 +1,4 @@ -;;; face-remap.el --- Functions for managing `face-remapping-alist' +;;; face-remap.el --- Functions for managing `face-remapping-alist' -*- lexical-binding: t -*- ;; ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. ;; @@ -285,7 +285,9 @@ See `text-scale-increase' for more details." ;;;###autoload (define-key ctl-x-map [(control ?0)] 'text-scale-adjust) ;;;###autoload (defun text-scale-adjust (inc) - "Increase or decrease the height of the default face in the current buffer. + "Adjust the height of the default face by INC. + +INC may be passed as a numeric prefix argument. The actual adjustment made depends on the final component of the key-binding used to invoke the command, with all modifiers removed: @@ -294,9 +296,11 @@ key-binding used to invoke the command, with all modifiers removed: - Decrease the default face height by one step 0 Reset the default face height to the global default -Then, continue to read input events and further adjust the face -height as long as the input event read (with all modifiers removed) -is one of the above. +When adjusting with `+' or `-', continue to read input events and +further adjust the face height as long as the input event read +\(with all modifiers removed) is `+' or `-'. + +When adjusting with `0', immediately finish. Each step scales the height of the default face by the variable `text-scale-mode-step' (a negative number of steps decreases the @@ -309,8 +313,7 @@ even when it is bound in a non-top-level keymap. For binding in a top-level keymap, `text-scale-increase' or `text-scale-decrease' may be more appropriate." (interactive "p") - (let ((first t) - (ev last-command-event) + (let ((ev last-command-event) (echo-keystrokes nil)) (let* ((base (event-basic-type ev)) (step @@ -320,19 +323,15 @@ a top-level keymap, `text-scale-increase' or (?0 0) (t inc)))) (text-scale-increase step) - ;; FIXME: do it after every "iteration of the loop". - (message "+,-,0 for further adjustment: ") + ;; (unless (zerop step) + (message "Use +,-,0 for further adjustment") (set-temporary-overlay-map (let ((map (make-sparse-keymap))) (dolist (mods '(() (control))) - (define-key map (vector (append mods '(?-))) 'text-scale-decrease) - (define-key map (vector (append mods '(?+))) 'text-scale-increase) - ;; = is unshifted + on most keyboards. - (define-key map (vector (append mods '(?=))) 'text-scale-increase) - (define-key map (vector (append mods '(?0))) - (lambda () (interactive) (text-scale-increase 0)))) - map) - t)))) + (dolist (key '(?- ?+ ?= ?0)) ;; = is often unshifted +. + (define-key map (vector (append mods (list key))) + (lambda () (interactive) (text-scale-adjust (abs inc)))))) + map))))) ;; ) ;; ---------------------------------------------------------------- From 372212dff2e3d84c676dc78ff27d7a0b5ec710de Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Oct 2012 13:20:54 -0400 Subject: [PATCH 049/109] * lisp/bookmark.el (bookmark-completing-read): Set the completion category to `bookmark'. Fixes: debbugs:11131 --- lisp/ChangeLog | 5 +++++ lisp/bookmark.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bda9ac0d4aa..c43b0c136e3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-26 Stefan Monnier + + * bookmark.el (bookmark-completing-read): Set the completion category + to `bookmark' (bug#11131). + 2012-10-26 Bastien Stefan Monnier 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." ": "))) (str (completing-read prompt - bookmark-alist + (lambda (string pred action) + (if (eq action 'metadata) + '(metadata (category . bookmark)) + (complete-with-action + action bookmark-alist string pred))) nil 0 nil From 150f809c341e3b711a78daee528ad40f68052ce6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Oct 2012 14:01:30 -0400 Subject: [PATCH 050/109] * lisp/emacs-lisp/advice.el (ad-assemble-advised-definition): Silence bogus compiler warnings for ad-do-it. --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/advice.el | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c43b0c136e3..7cb9fb0793c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-26 Stefan Monnier + * emacs-lisp/advice.el (ad-assemble-advised-definition): + Silence bogus compiler warnings for ad-do-it. + * bookmark.el (bookmark-completing-read): Set the completion category to `bookmark' (bug#11131). 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, ORIG is a form that calls the body of the original unadvised function, and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG should be modified. The assembled function will be returned." - - (let (before-forms around-form around-form-protected after-forms definition) + ;; The ad-do-it call should always have the right number of arguments, + ;; but the compiler might signal a bogus warning because it checks the call + ;; against the advertised calling convention. + (let ((around-form `(setq ad-return-value (with-no-warnings ,orig))) + before-forms around-form-protected after-forms definition) (dolist (advice befores) (cond ((and (ad-advice-protected advice) before-forms) @@ -2911,7 +2914,6 @@ should be modified. The assembled function will be returned." (append before-forms (ad-body-forms (ad-advice-definition advice))))))) - (setq around-form `(setq ad-return-value ,orig)) (dolist (advice (reverse arounds)) ;; If any of the around advices is protected then we ;; protect the complete around advice onion: From 59696ae01cb838bb5d6128cda29e4c825cdb1f7e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 26 Oct 2012 14:35:36 -0400 Subject: [PATCH 051/109] * Makefile.in (EMACS_NAME): New variable. (EMACS, install-etc, uninstall): Use $EMACS_NAME. --- ChangeLog | 3 +++ Makefile.in | 17 +++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9498dbfeb1..d4aa9c935ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2012-10-26 Glenn Morris + * Makefile.in (EMACS_NAME): New variable. + (EMACS, install-etc, uninstall): Use $EMACS_NAME. + * Makefile.in (EMACS, EMACSFULL): Transformations should not be applied to $EXEEXT. diff --git a/Makefile.in b/Makefile.in index 29aed2b0be8..78630ef58ff 100644 --- a/Makefile.in +++ b/Makefile.in @@ -259,7 +259,8 @@ GZIP_INFO = @GZIP_INFO@ TRANSFORM = @program_transform_name@ # What emacs should be called when installed. -EMACS = `echo emacs | sed '$(TRANSFORM)'`${EXEEXT} +EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'` +EMACS = ${EMACS_NAME}${EXEEXT} EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT} # Subdirectories to make recursively. @@ -633,12 +634,12 @@ install-man: ## Install those items from etc/ that need to end up elsewhere. install-etc: umask 022; ${MKDIR_P} $(DESTDIR)${desktopdir} - dest=`echo emacs | sed '$(TRANSFORM)'`; \ tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \ - sed -e "/^Exec=emacs/ s/emacs/$${dest}/" \ - -e "/^Icon=emacs/ s/emacs/$${dest}/" \ + emacs_name=`echo emacs | sed '$(TRANSFORM)'`; \ + sed -e "/^Exec=emacs/ s/emacs/$${emacs_name}/" \ + -e "/^Icon=emacs/ s/emacs/$${emacs_name}/" \ ${srcdir}/etc/emacs.desktop > $${tmp}; \ - ${INSTALL_DATA} $${tmp} $(DESTDIR)${desktopdir}/$${dest}.desktop; \ + ${INSTALL_DATA} $${tmp} $(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop; \ rm -f $${tmp} thisdir=`/bin/pwd`; \ cd ${iconsrcdir} || exit 1; umask 022 ; \ @@ -702,11 +703,11 @@ uninstall: fi) (cd $(DESTDIR)${bindir} && rm -f $(EMACSFULL) $(EMACS) || true) (if cd $(DESTDIR)${icondir}; then \ - rm -f hicolor/*x*/apps/`echo emacs | sed '$(TRANSFORM)'`.png \ - hicolor/scalable/apps/`echo emacs | sed '$(TRANSFORM)'`.svg \ + rm -f hicolor/*x*/apps/${EMACS_NAME}.png \ + hicolor/scalable/apps/${EMACS_NAME}.svg \ hicolor/scalable/mimetypes/`echo emacs-document | sed '$(TRANSFORM)'`.svg; \ fi) - -rm -f $(DESTDIR)${desktopdir}/`echo emacs | sed '$(TRANSFORM)'`.desktop + -rm -f $(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop for file in snake-scores tetris-scores; do \ file=$(DESTDIR)${gamedir}/$${file}; \ [ -s $${file} ] || rm -f $$file; \ From 55f197b2192f30e1207fe67aef9ddbb02e2712e5 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Fri, 26 Oct 2012 16:44:38 -0400 Subject: [PATCH 052/109] * lisp/minibuffer.el (completion-category-overrides): New completion category `bookmark'. Fixes: debbugs:11131 --- lisp/ChangeLog | 5 +++++ lisp/minibuffer.el | 1 + 2 files changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7cb9fb0793c..4f6e37af6ee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-26 Jambunathan K + + * minibuffer.el (completion-category-overrides): New completion + category `bookmark' (bug#11131). + 2012-10-26 Stefan Monnier * emacs-lisp/advice.el (ad-assemble-advised-definition): diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 4421e325b91..52c3a0ba659 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -743,6 +743,7 @@ completing buffer and file names, respectively." (const buffer) (const file) (const unicode-name) + (const bookmark) symbol) :value-type (set :tag "Properties to override" From 05b621a6b22cb1c856a9f223d79203cb3ceaf29a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 27 Oct 2012 13:03:52 +0800 Subject: [PATCH 053/109] More Emacs 24.3 documentation updates. * doc/emacs/building.texi (Compilation): Document compilation-always-kill. * doc/emacs/files.texi (Misc File Ops): Symbolic links on Windows only work on Vista and later. * doc/emacs/frames.texi (Mouse Avoidance): Mention new variable mouse-avoidance-banish-position. * doc/emacs/mule.texi (Recognize Coding): Remove an unreferenced vindex. * doc/emacs/package.texi (Package Menu): Document the "new" status. * doc/emacs/programs.texi (Which Function): Which Function mode now works in all major modes by default. * doc/emacs/search.texi (Symbol Search): New node. * doc/emacs/windows.texi (Window Choice): Don't refer to the obsolete special-display feature. * commands.texi (Event Input Misc): Remove last-input-char. (Command Loop Info): Remove last-command-char. * display.texi (Fringe Bitmaps): Add exclamation-mark bitmap. * frames.texi (Initial Parameters): Don't mention the obsolete special-display feature. * hooks.texi (Standard Hooks): Remove obsolete hooks. * markers.texi (Information from Markers): Remove obsolete function buffer-has-markers-at. * minibuf.texi (High-Level Completion): Don't mention removed function iswitchb-read-buffer. * text.texi (Yanking): Document yank-handled-properties. * windows.texi (Choosing Window): Don't mention the obsolete special display feature. (Choosing Window Options): Remove obsolete special-display variables, and the functions special-display-p and special-display-popup-frame. * subr.el (insert-buffer-substring-as-yank): Doc fix. --- doc/emacs/ChangeLog | 22 ++++++++ doc/emacs/building.texi | 7 ++- doc/emacs/emacs.texi | 1 + doc/emacs/files.texi | 5 +- doc/emacs/frames.texi | 16 +++--- doc/emacs/mule.texi | 1 - doc/emacs/package.texi | 8 ++- doc/emacs/programs.texi | 13 ++--- doc/emacs/search.texi | 42 ++++++++++++++++ doc/emacs/windows.texi | 6 --- doc/lispref/ChangeLog | 26 ++++++++++ doc/lispref/anti.texi | 5 +- doc/lispref/commands.texi | 11 ---- doc/lispref/display.texi | 4 +- doc/lispref/frames.texi | 8 ++- doc/lispref/hooks.texi | 8 --- doc/lispref/markers.texi | 5 -- doc/lispref/minibuf.texi | 8 ++- doc/lispref/text.texi | 87 +++++++++++++++++++------------- doc/lispref/windows.texi | 103 -------------------------------------- etc/NEWS | 41 +++++++++++---- lisp/ChangeLog | 4 ++ lisp/subr.el | 4 +- 23 files changed, 219 insertions(+), 216 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index b911153f080..edfbecf9634 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,25 @@ +2012-10-27 Chong Yidong + + * frames.texi (Mouse Avoidance): Mention new variable + mouse-avoidance-banish-position. + + * programs.texi (Which Function): Which Function mode now works in + all major modes by default. + + * mule.texi (Recognize Coding): Remove an unreferenced vindex. + + * files.texi (Misc File Ops): Symbolic links on Windows only work + on Vista and later. + + * building.texi (Compilation): Document compilation-always-kill. + + * search.texi (Symbol Search): New node. + + * package.texi (Package Menu): Document the "new" status. + + * windows.texi (Window Choice): Don't refer to the obsolete + special-display feature. + 2012-10-24 Chong Yidong * mule.texi (Text Coding): set-buffer-file-coding-system can now 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 was started. @findex kill-compilation +@vindex compilation-always-kill Starting a new compilation also kills any compilation already running in @file{*compilation*}, as the buffer can only handle one compilation at any time. However, @kbd{M-x compile} asks for -confirmation before actually killing a compilation that is running. -You can also kill the compilation process with @kbd{M-x +confirmation before actually killing a compilation that is running; to +always automatically kill the compilation without asking, change the +variable @code{compilation-always-kill} to @code{t}. You can also +kill a compilation process with the command @kbd{M-x kill-compilation}. To run two compilations at once, start the first one, then rename 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 * Incremental Search:: Search happens as you type the string. * Nonincremental Search:: Specify entire string and then search. * Word Search:: Search for sequence of words. +* Symbol Search:: Search for a source code symbol. * Regexp Search:: Search for match for a regexp. * Regexps:: Syntax of regular expressions. * 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 @var{target} at the time the opening is done, or will get an error if the name @var{target} is nonexistent at that time. This command does not expand the argument @var{target}, so that it allows you to specify -a relative name as the target of the link. Not all systems support -symbolic links; on systems that don't support them, this command is -not defined. +a relative name as the target of the link. On MS-Windows, this +command works only on MS Windows Vista and later. @kindex C-x i @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: @table @code @item banish -Move the mouse to the upper-right corner on any key-press; +Move the pointer to a corner of the frame on any key-press. You can +customize the variable @code{mouse-avoidance-banish-position} to +specify where the pointer goes when it is banished. @item exile -Move the mouse to the corner only if the cursor gets too close, -and allow it to return once the cursor is out of the way; +Banish the pointer only if the cursor gets too close, and allow it to +return once the cursor is out of the way. @item jump -If the cursor gets too close to the mouse, displace the mouse -a random distance & direction; +If the cursor gets too close to the pointer, displace the pointer by a +random distance and direction. @item animate -As @code{jump}, but shows steps along the way for illusion of motion; +As @code{jump}, but shows steps along the way for illusion of motion. @item cat-and-mouse -The same as @code{animate}; +The same as @code{animate}. @item proteus As @code{animate}, but changes the shape of the mouse pointer too. @end table diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index d7ed6cc488f..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 @samp{-*-coding:-*-} tag. @c FIXME? This seems somewhat out of place. Move to the Rmail section? -@vindex rmail-decode-mime-charset @vindex rmail-file-coding-system When you get new mail in Rmail, each message is translated automatically from the coding system it is written in, as if it were a 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 downloaded from the package archive), @samp{installed}, or @samp{built-in} (included in Emacs by default). -In some instances, the status can be @samp{held}, @samp{disabled}, or -@samp{obsolete}. @xref{Package Installation}. +The status can also be @samp{new}. This is equivalent to +@samp{available}, except that it means the package became newly +available on the package archive after your last invocation of +@kbd{M-x list-packages}. In other instances, a package may have the +status @samp{held}, @samp{disabled}, or @samp{obsolete}. +@xref{Package Installation}. @item 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. @findex which-function-mode @vindex which-func-modes To either enable or disable Which Function mode, use the command -@kbd{M-x which-function-mode}. Although Which Function mode is a -global minor mode, it takes effect only in certain major modes: those -listed in the variable @code{which-func-modes}. If the value of -@code{which-func-modes} is @code{t} rather than a list of modes, then -Which Function mode applies to all major modes that know how to -support it---in other words, all the major modes that support Imenu. +@kbd{M-x which-function-mode}. Which Function mode is a global minor +mode. By default, it takes effect in all major modes major modes that +know how to support it (i.e.@: all the major modes that support +Imenu). You can restrict it to a specific list of major modes by +changing the value of the variable @code{which-func-modes} from +@code{t} (which means to support all available major modes) to a list +of major mode names. @node Program Indent @section Indentation for Programs 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. * Incremental Search:: Search happens as you type the string. * Nonincremental Search:: Specify entire string and then search. * Word Search:: Search for sequence of words. +* Symbol Search:: Search for a source code symbol. * Regexp Search:: Search for match for a regexp. * Regexps:: Syntax of regular expressions. * Regexp Backslash:: Regular expression constructs starting with `\'. @@ -467,6 +468,47 @@ the search string can match part of a word, so that the matching proceeds incrementally as you type. This additional laxity does not apply to the lazy highlight, which always matches whole words. +@node Symbol Search +@section Symbol Search +@cindex symbol search + + A @dfn{symbol search} is much like an ordinary search, except that +the boundaries of the search must match the boundaries of a symbol. +The meaning of @dfn{symbol} in this context depends on the major mode, +and usually refers to a source code token, such as a Lisp symbol in +Emacs Lisp mode. For instance, if you perform an incremental symbol +search for the Lisp symbol @code{forward-word}, it would not match +@code{isearch-forward-word}. This feature is thus mainly useful for +searching source code. + +@table @kbd +@item M-s _ +If incremental search is active, toggle symbol search mode +(@code{isearch-toggle-symbol}); otherwise, begin an incremental +forward symbol search (@code{isearch-forward-symbol}). +@item M-s _ @key{RET} @var{symbol} @key{RET} +Search forward for @var{symbol}, nonincrementally. +@item M-s _ C-r @key{RET} @var{symbol} @key{RET} +Search backward for @var{symbol}, nonincrementally. +@end table + +@kindex M-s _ +@findex isearch-forward-symbol + To begin a forward incremental symbol search, type @kbd{M-s _}. If +incremental search is not already active, this runs the command +@code{isearch-forward-symbol}. If incremental search is already +active, @kbd{M-s _} switches to a symbol search, preserving the +direction of the search and the current search string; you can disable +symbol search by typing @kbd{M-s _} again. In incremental symbol +search, only the beginning of the search string is required to match +the beginning of a symbol. + + To begin a nonincremental symbol search, type @kbd{M-s _ @key{RET}} +for a forward search, or @kbd{M-s _ C-r @key{RET}} or a backward +search. In nonincremental symbol searches, the beginning and end of +the search string are required to match the beginning and end of a +symbol, respectively. + @node Regexp Search @section Regular Expression Search @cindex regexp search 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, are considered, but windows on other frames are also reusable if you change @code{pop-up-frames} (see below) to @code{t}. -@item -Otherwise, if you specified that the buffer should be displayed in a -special frame by customizing @code{special-display-buffer-names} or -@code{special-display-regexps}, do so. @xref{Choosing Window -Options,,, elisp, The Emacs Lisp Reference Manual}. - @vindex pop-up-frames @item Otherwise, optionally create a new frame and display the buffer there. diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 25dee5212e5..c7fb29a6fb1 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,29 @@ +2012-10-27 Chong Yidong + + * minibuf.texi (High-Level Completion): Don't mention removed + function iswitchb-read-buffer. + + * commands.texi (Event Input Misc): Remove last-input-char. + (Command Loop Info): Remove last-command-char. + + * frames.texi (Initial Parameters): Don't mention the obsolete + special-display feature. + + * windows.texi (Choosing Window): Don't mention the obsolete + special display feature. + (Choosing Window Options): Remove obsolete special-display + variables, and the functions special-display-p and + special-display-popup-frame. + + * display.texi (Fringe Bitmaps): Add exclamation-mark bitmap. + + * hooks.texi (Standard Hooks): Remove obsolete hooks. + + * markers.texi (Information from Markers): Remove obsolete + function buffer-has-markers-at. + + * text.texi (Yanking): Document yank-handled-properties. + 2012-10-24 Paul Eggert Update manual for new time stamp format (Bug#12706). 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 related variables, as well as the @var{action} argument to @code{display-buffer} and other functions. The way to programmatically control how Emacs chooses a window to display a -buffer is to bind the right combination of -@code{special-display-regexps}, @code{pop-up-frames}, and other -variables. +buffer is to bind the right combination of @code{pop-up-frames} and +other variables. @item The standard completion interface has been simplified, eliminating the 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 the name of an existing buffer, which becomes the second and final argument. -@c Emacs 19 feature The prompt string can use @samp{%} to include previous argument values (starting with the first argument) in the prompt. This is done using @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 signaled if the buffer is read-only. @cindex @samp{@@} in @code{interactive} -@c Emacs 19 feature If @samp{@@} appears at the beginning of the string, and if the key sequence used to invoke the command includes any mouse events, then 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} @end defvar @defvar last-command-event -@defvarx last-command-char This variable is set to the last input event that was read by the command loop as part of a command. The principal use of this variable is in @code{self-insert-command}, which uses it to decide which @@ -926,11 +923,8 @@ last-command-event @noindent The value is 5 because that is the @acronym{ASCII} code for @kbd{C-e}. - -The alias @code{last-command-char} is obsolete. @end defvar -@c Emacs 19 feature @defvar last-event-frame This variable records which frame the last input event was directed to. 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: @end example @defvar num-input-keys -@c Emacs 19 feature This variable's value is the number of key sequences processed so far in this Emacs session. This includes key sequences read from the terminal 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. @code{keyboard-translate-table} (if applicable), before returning it from @code{read-event}. -@c Emacs 19 feature @defvar extra-keyboard-modifiers This variable lets Lisp programs ``press'' the modifier keys on the keyboard. The value is a character. Only the modifiers of the @@ -2755,7 +2747,6 @@ may return @code{t} when no input is available. @end defun @defvar last-input-event -@defvarx last-input-char This variable records the last terminal input event read, whether as part of a command or explicitly by a Lisp program. @@ -2774,8 +2765,6 @@ this expression) remains the value of @code{last-command-event}. @result{} 49 @end group @end example - -The alias @code{last-input-char} is obsolete. @end defvar @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. @itemx @code{vertical-bar}, @code{horizontal-bar} Used for different types of fringe cursors. -@item @code{empty-line}, @code{question-mark}, @code{exclamation-mark} -Unused. +@item @code{empty-line}, @code{exclamation-mark}, @code{question-mark}, @code{exclamation-mark} +Not used by core Emacs features. @end table @noindent diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index af6f4b4c079..665b75048f3 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 Window System, you can get the same results by means of X resources in many cases. -Setting this variable does not affect existing frames. +Setting this variable does not affect existing frames. Furthermore, +functions that display a buffer in a separate frame may override the +default parameters by supplying their own parameters. @end defopt -Functions that display a buffer in a separate frame can override the -default parameters by supplying their own parameters. @xref{Definition -of special-display-frame-alist}. - If you invoke Emacs with command-line options that specify frame appearance, those options take effect by adding elements to either @code{initial-frame-alist} or @code{default-frame-alist}. Options 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.). @item delete-terminal-functions @xref{Multiple Terminals}. -@ignore -@item disabled-command-function -@xref{Disabling Commands}. -@end ignore - -@item display-buffer-function @itemx pop-up-frame-function -@itemx special-display-function @itemx split-window-preferred-function @xref{Choosing Window Options}. @@ -272,7 +265,6 @@ deferred-action-function input-method-function load-read-function load-source-file-function -macro-declaration-function read-buffer-function ring-bell-function select-safe-coding-system-function 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 @end example @end defun -@defun buffer-has-markers-at position -This function returns @code{t} if one or more markers -point at position @var{position} in the current buffer. -@end defun - @node Marker Insertion Types @section Marker Insertion Types diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 79c83144f77..7243f46b882 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1218,11 +1218,9 @@ Buffer name (default foo): @point{} @end defun @defopt read-buffer-function -This variable specifies how to read buffer names. The function is -called with the arguments passed to @code{read-buffer}. For example, -if you set this variable to @code{iswitchb-read-buffer}, all Emacs -commands that call @code{read-buffer} to read a buffer name will -actually use the @code{iswitchb} package to read it. +This variable, if non-@code{nil}, specifies a function for reading +buffer names. @code{read-buffer} calls this function instead of doing +its usual work, with the same arguments passed to @code{read-buffer}. @end defopt @defopt read-buffer-completion-ignore-case 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 @node Yanking @subsection Yanking - Yanking means inserting text from the kill ring, but it does -not insert the text blindly. Yank commands and some other commands -use @code{insert-for-yank} to perform special processing on the -text that they copy into the buffer. + Yanking means inserting text from the kill ring, but it does not +insert the text blindly. The @code{yank} command, and related +commands, use @code{insert-for-yank} to perform special processing on +the text before it is inserted. @defun insert-for-yank string -This function normally works like @code{insert} except that it doesn't -insert the text properties (@pxref{Text Properties}) in the list -variable @code{yank-excluded-properties}. However, if any part of -@var{string} has a non-@code{nil} @code{yank-handler} text property, -that property can do various special processing on that part of the -text being inserted. +This function works like @code{insert}, except that it processes the +text in @var{string} according to the @code{yank-handler} text +property, as well as the variables @code{yank-handled-properties} and +@code{yank-excluded-properties} (see below), before inserting the +result into the current buffer. @end defun @defun insert-buffer-substring-as-yank buf &optional start end -This function resembles @code{insert-buffer-substring} except that it -doesn't insert the text properties in the -@code{yank-excluded-properties} list. +This function resembles @code{insert-buffer-substring}, except that it +processes the text according to @code{yank-handled-properties} and +@code{yank-excluded-properties}. (It does not handle the +@code{yank-handler} property, which does not normally occur in buffer +text anyway.) @end defun - You can put a @code{yank-handler} text property on all or part of -the text to control how it will be inserted if it is yanked. The -@code{insert-for-yank} function looks for that property. The property -value must be a list of one to four elements, with the following -format (where elements after the first may be omitted): + If you put a @code{yank-handler} text property on all or part of a +string, that alters how @code{insert-for-yank} inserts the string. If +different parts of the string have different @code{yank-handler} +values (comparison being done with @code{eq}), each substring is +handled separately. The property value must be a list of one to four +elements, with the following format (where elements after the first +may be omitted): @example (@var{function} @var{param} @var{noexclude} @var{undo}) @@ -933,22 +936,21 @@ format (where elements after the first may be omitted): @table @var @item function -When @var{function} is present and non-@code{nil}, it is called instead of -@code{insert} to insert the string. @var{function} takes one -argument---the string to insert. +When @var{function} is non-@code{nil}, it is called instead of +@code{insert} to insert the string, with one argument---the string to +insert. @item param If @var{param} is present and non-@code{nil}, it replaces @var{string} -(or the part of @var{string} being processed) as the object passed to -@var{function} (or @code{insert}); for example, if @var{function} is -@code{yank-rectangle}, @var{param} should be a list of strings to -insert as a rectangle. +(or the substring of @var{string} being processed) as the object +passed to @var{function} (or @code{insert}). For example, if +@var{function} is @code{yank-rectangle}, @var{param} should be a list +of strings to insert as a rectangle. @item noexclude -If @var{noexclude} is present and non-@code{nil}, the normal removal of the -yank-excluded-properties is not performed; instead @var{function} is -responsible for removing those properties. This may be necessary -if @var{function} adjusts point before or after inserting the object. +If @var{noexclude} is present and non-@code{nil}, that disables the +normal action of @code{yank-handled-properties} and +@code{yank-excluded-properties} on the inserted string. @item undo If @var{undo} is present and non-@code{nil}, it is a function that will be @@ -959,14 +961,29 @@ the @var{undo} value. @end table @cindex yanking and text properties -@defopt yank-excluded-properties -Yanking discards certain text properties from the yanked text, as -described above. The value of this variable is the list of properties -to discard. Its default value contains properties that might lead to -annoying results, such as causing the text to respond to the mouse or -specifying key bindings. +@defopt yank-handled-properties +This variable specifies special text property handling conditions for +yanked text. It takes effect after the text has been inserted (either +normally, or via the @code{yank-handler} property), and prior to +@code{yank-excluded-properties} taking effect. + +The value should be an alist of elements @code{(@var{prop} +. @var{fun})}. Each alist element is handled in order. The inserted +text is scanned for stretches of text having text properties @code{eq} +to @var{prop}; for each such stretch, @var{fun} is called with three +arguments: the value of the property, and the start and end positions +of the text. @end defopt +@defopt yank-excluded-properties +The value of this variable is the list of properties to remove from +inserted text. Its default value contains properties that might lead +to annoying results, such as causing the text to respond to the mouse +or specifying key bindings. It takes effect after +@code{yank-handled-properties}. +@end defopt + + @node Yank Commands @subsection Functions for Yanking diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index ea48a46359c..31d33bffbdd 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1631,11 +1631,6 @@ The variable @code{display-buffer-overriding-action}. @item The user option @code{display-buffer-alist}. -@item -A special action for handling @code{special-display-buffer-names} and -@code{special-display-regexps}, if either of those variables is -non-@code{nil}. @xref{Choosing Window Options}. - @item The @var{action} argument. @@ -1864,91 +1859,6 @@ Parameters}), which is used by the default function in @code{nil}. @end defopt -@defopt special-display-buffer-names -A list of buffer names identifying buffers that should be displayed -specially. If the name of @var{buffer-or-name} is in this list, -@code{display-buffer} handles the buffer specially. By default, special -display means to give the buffer a dedicated frame. - -If an element is a list, instead of a string, then the @sc{car} of that -list is the buffer name, and the rest of that list says how to create -the frame. There are two possibilities for the rest of that list (its -@sc{cdr}): It can be an alist, specifying frame parameters, or it can -contain a function and arguments to give to it. (The function's first -argument is always the buffer to be displayed; the arguments from the -list come after that.) - -For example: - -@example -(("myfile" (minibuffer) (menu-bar-lines . 0))) -@end example - -@noindent -specifies to display a buffer named @samp{myfile} in a dedicated frame -with specified @code{minibuffer} and @code{menu-bar-lines} parameters. - -The list of frame parameters can also use the phony frame parameters -@code{same-frame} and @code{same-window}. If the specified frame -parameters include @code{(same-window . @var{value})} and @var{value} -is non-@code{nil}, that means to display the buffer in the current -selected window. Otherwise, if they include @code{(same-frame . -@var{value})} and @var{value} is non-@code{nil}, that means to display -the buffer in a new window in the currently selected frame. -@end defopt - -@defopt special-display-regexps -A list of regular expressions specifying buffers that should be -displayed specially. If the buffer's name matches any of the regular -expressions in this list, @code{display-buffer} handles the buffer -specially. By default, special display means to give the buffer a -dedicated frame. - -If an element is a list, instead of a string, then the @sc{car} of the -list is the regular expression, and the rest of the list says how to -create the frame. See @code{special-display-buffer-names} above. -@end defopt - -@defun special-display-p buffer-name -This function returns non-@code{nil} if displaying a buffer -named @var{buffer-name} with @code{display-buffer} would -create a special frame. The value is @code{t} if it would -use the default frame parameters, or else the specified list -of frame parameters. -@end defun - -@defopt special-display-function -This variable holds the function to call to display a buffer specially. -It receives the buffer as an argument, and should return the window in -which it is displayed. The default value of this variable is -@code{special-display-popup-frame}, see below. -@end defopt - -@defun special-display-popup-frame buffer &optional args -This function tries to make @var{buffer} visible in a frame of its own. -If @var{buffer} is already displayed in some window, it makes that -window's frame visible and raises it. Otherwise, it creates a frame -that is dedicated to @var{buffer}. The return value is the window used -to display @var{buffer}. - -If @var{args} is an alist, it specifies frame parameters for the new -frame. If @var{args} is a list whose @sc{car} is a symbol, then -@code{(car @var{args})} is a function to actually create and -set up the frame; it is called with @var{buffer} as first argument, and -@code{(cdr @var{args})} as additional arguments. - -This function always uses an existing window displaying @var{buffer}, -whether or not it is in a frame of its own; but if you set up the above -variables in your init file, before @var{buffer} was created, then -presumably the window was previously made by this function. -@end defun - -@defopt special-display-frame-alist -@anchor{Definition of special-display-frame-alist} -This variable holds frame parameters for -@code{special-display-popup-frame} to use when it creates a frame. -@end defopt - @defopt same-window-buffer-names A list of buffer names for buffers that should be displayed in the selected window. If a buffer's name is in this list, @@ -1969,19 +1879,6 @@ named @var{buffer-name} with @code{display-buffer} would put it in the selected window. @end defun -@c Emacs 19 feature -@defopt display-buffer-function -This variable is the most flexible way to customize the behavior of -@code{display-buffer}. If it is non-@code{nil}, it should be a function -that @code{display-buffer} calls to do the work. The function should -accept two arguments, the first two arguments that @code{display-buffer} -received. It should choose or create a window, display the specified -buffer in it, and then return the window. - -This variable takes precedence over all the other options described -above. -@end defopt - @node Window History @section Window History @cindex window history diff --git a/etc/NEWS b/etc/NEWS index dbf580285e8..45ca56f5da6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -157,6 +157,7 @@ or expression to evaluate. --- *** New option `server-auth-key' specifies a shared server key. ++++ ** In the Package Menu, newly-available packages are listed as "new", and sorted above the other "available" packages by default. @@ -229,7 +230,7 @@ This applies to both ordinary and regexp Isearch. *** New option `replace-lax-whitespace'. If non-nil, `query-replace' uses flexible whitespace matching too. The default is nil. - ++++ *** Global `M-s _' starts a symbol (identifier) incremental search, and `M-s _' in Isearch toggles symbol search mode. `M-s c' in Isearch toggles search case-sensitivity. @@ -263,6 +264,7 @@ append-to-register and M-x prepend-to-register. ** New command `C-x r M-w' (copy-rectangle-as-kill). It copies the region-rectangle as the last rectangle kill. ++++ ** New option `yank-handled-properties' allows processing of text properties on yanked text, in more ways that are more general than just removing them, as done by `yank-excluded-properties'. @@ -327,7 +329,7 @@ A side effect is that vars without corresponding value are bound to nil rather than making them unbound. ** Compilation mode - ++++ *** New option `compilation-always-kill'. ** Customize @@ -441,9 +443,9 @@ the FFAP prompt. The default is now '("ftp"). The old binding for `/ M' (filter by used-mode) is now bound to `/ m'. ** Mouse Avoidance mode - -The new variable `mouse-avoidance-banish-position' can now be used to -customize Mouse Avoidance mode further. ++++ +*** New variable `mouse-avoidance-banish-position' specifies where the +`banish' mouse avoidance setting moves the mouse. +++ ** notifications.el supports now version 1.2 of the Notifications API. @@ -595,6 +597,7 @@ and the `attributes' slot is always nil. The `url-retrieve' function now uses this to encode its URL argument, in case that is not properly encoded. +--- ** VHDL mode *** The free software compiler GHDL is supported (and now the default). @@ -605,7 +608,10 @@ in case that is not properly encoded. *** Accepts \r and \f as whitespace. -** which-function-mode now applies to all applicable major modes by default. +** Which Function mode ++++ +*** `which-func-modes' now defaults to t, so Which Function mode, when +enabled, applies to all applicable major modes. --- ** winner-mode-hook now runs when the mode is disabled, as well as when it is @@ -708,6 +714,7 @@ still be supported for Emacs 24.x. Some Lisp symbols have been renamed to avoid problems with spelling that is incorrect or inconsistent with how Emacs normally spells a word. +--- *** Renamed functions **** hangul-input-method-inactivate -> hangul-input-method-deactivate @@ -719,22 +726,22 @@ that is incorrect or inconsistent with how Emacs normally spells a word. viper-deactivate-input-method-action **** ucs-input-inactivate -> ucs-input-deactivate +--- *** Renamed hooks The old hooks are still supported for backward compatibility, but they are deprecated and will be removed eventually. - **** input-method-inactivate-hook -> input-method-deactivate-hook **** robin-inactivate-hook -> robin-deactivate-hook **** quail-inactivate-hook -> quail-deactivate-hook +--- *** Renamed Lisp variables - **** follow-deactive-menu -> follow-inactive-menu **** inactivate-current-input-method-function -> deactivate-current-input-method-function ++++ ** Some obsolete functions, variables, and faces were removed: - *** `facemenu-unlisted-faces' *** `rmail-decode-mime-charset' *** `last-input-char', `last-command-char', `unread-command-char'. @@ -835,11 +842,17 @@ appropriate entries in the `display-buffer-alist' function introduced in Emacs 24.1: +++ **** `display-buffer-reuse-frames' ++++ **** `special-display-regexps' ++++ **** `special-display-frame-alist' ++++ **** `special-display-buffer-names' ++++ **** `special-display-function' ++++ **** `display-buffer-function' +--- **** `dired-shrink-to-fit' ** Time @@ -897,19 +910,26 @@ describing the cycle. ** New macros `setq-local' and `defvar-local'. ++++ ** New fringe bitmap `exclamation-mark'. ** Face underlining can now use a wave. See the "Face Attributes" section of the Elisp manual. ** The following functions and variables are obsolete: - +--- *** `automount-dir-prefix' ++++ *** `buffer-has-markers-at' +--- *** `macro-declaration-function' (use `macro-declarations-alist') +--- *** `window-system-version' +--- *** `dired-pop-to-buffer' (use `dired-mark-pop-up') +--- *** `query-replace-interactive' +--- *** `font-list-limit' (has had no effect since Emacs < 23) @@ -928,6 +948,7 @@ machinery to convert between Cygwin and Windows-native file names. Emacs now supports mouse highlight, help-echo (in the echo area), and `mouse-autoselect-window'. ++++ ** On MS Windows Vista and later Emacs now supports symbolic links. +++ diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4f6e37af6ee..d3462315fae 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-27 Chong Yidong + + * subr.el (insert-buffer-substring-as-yank): Doc fix. + 2012-10-26 Jambunathan K * minibuffer.el (completion-category-overrides): New completion 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." BUFFER may be a buffer or a buffer name. Arguments START and END are character positions specifying the substring. They default to the values of (point-min) and (point-max) in BUFFER. -Strip text properties from the inserted text according to -`yank-excluded-properties'." +Before insertion, process text properties according to +`yank-handled-properties' and `yank-excluded-properties'." ;; Since the buffer text should not normally have yank-handler properties, ;; there is no need to handle them here. (let ((opoint (point))) From df171c230cc8a5da73684740ff5cfa364fa8c1c4 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 27 Oct 2012 10:58:30 +0200 Subject: [PATCH 054/109] In display-time-world restore fit-window-to-buffer behavior. * window.el (display-buffer): In doc-string describe window-height and window-width alist entries. * time.el (display-time-world): Restore fit-window-to-buffer behavior. --- lisp/ChangeLog | 10 +++++++++- lisp/time.el | 3 ++- lisp/window.el | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d3462315fae..defa35f09ee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-10-27 Martin Rudalics + + * window.el (display-buffer): In doc-string describe + window-height and window-width alist entries. + + * time.el (display-time-world): Restore fit-window-to-buffer + behavior. + 2012-10-27 Chong Yidong * subr.el (insert-buffer-substring-as-yank): Doc fix. @@ -253,7 +261,7 @@ Recover input meta mode when the new coding system doesn not use 8-bit. Supply TERMINAL arg to set-input-meta-mode. -2012-10-17 Michael Heerdegen (tiny change) +2012-10-17 Michael Heerdegen * wdired.el (wdired-old-marks): New variable. (wdired-change-to-wdired-mode): Locally set wdired-old-marks. diff --git a/lisp/time.el b/lisp/time.el index 7473994ffa5..a3bbee0c893 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -557,7 +557,8 @@ To turn off the world time display, go to that window and type `q'." (run-at-time t display-time-world-timer-second 'display-time-world-timer)) (with-current-buffer (get-buffer-create display-time-world-buffer-name) (display-time-world-display display-time-world-list) - (display-buffer display-time-world-buffer-name) + (display-buffer display-time-world-buffer-name + (cons nil '((window-height . fit-window-to-buffer)))) (display-time-world-mode))) (defun display-time-world-timer () 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: parameters to give a new frame, if one is created. + `window-height' -- Value specifies either an integer (the number + of lines of a new window), a floating point number (the + fraction of a new window with respect to the height of the + frame's root window) or a function to be called with one + argument - a new window. The function is supposed to adjust + the height of the window; its return value is ignored. + Suitable functions are `shrink-window-if-larger-than-buffer' + and `fit-window-to-buffer'. + + `window-width' -- Value specifies either an integer (the number + of columns of a new window), a floating point number (the + fraction of a new window with respect to the width of the + frame's root window) or a function to be called with one + argument - a new window. The function is supposed to adjust + the width of the window; its return value is ignored. + The ACTION argument to `display-buffer' can also have a non-nil and non-list value. This means to display the buffer in a window other than the selected one, even if it is already displayed in From e2f022a3fa6986eea4df942dc52a00ae70ec193f Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sat, 27 Oct 2012 12:17:14 +0300 Subject: [PATCH 055/109] * lisp/wdired.el (wdired-keep-marker-rename): New defcustom. (wdired-do-renames): Use it instead of `dired-keep-marker-rename'. * lisp/dired.el (dired-keep-marker-rename): Add reference to `wdired-keep-marker-rename' in the docstring. Add default character value ?R to display initially in Customization UI instead of ?@. Fixes: debbugs:11795 --- lisp/ChangeLog | 11 +++++++++++ lisp/dired.el | 7 +++++-- lisp/wdired.el | 25 ++++++++++++++++++++++--- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index defa35f09ee..c6e940ba0fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2012-10-27 Juri Linkov + + * wdired.el (wdired-keep-marker-rename): New defcustom. + (wdired-do-renames): Use it instead of `dired-keep-marker-rename'. + (Bug#11795) + + * dired.el (dired-keep-marker-rename): Add reference to + `wdired-keep-marker-rename' in the docstring. + Add default character value ?R to display initially in + Customization UI instead of ?@. + 2012-10-27 Martin Rudalics * window.el (display-buffer): In doc-string describe diff --git a/lisp/dired.el b/lisp/dired.el index fb2f7281130..5f7ee48a810 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -137,9 +137,12 @@ A value of t means move to first file." "Controls marking of renamed files. If t, files keep their previous marks when they are renamed. If a character, renamed files (whether previously marked or not) -are afterward marked with that character." +are afterward marked with that character. +This option affects only files renamed by `dired-do-rename' and +`dired-do-rename-regexp'. See `wdired-keep-marker-rename' +if you want to do the same for files renamed in WDired mode." :type '(choice (const :tag "Keep" t) - (character :tag "Mark")) + (character :tag "Mark" :value ?R)) :group 'dired-mark) (defcustom dired-keep-marker-copy ?C 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." (other :tag "Bits freely editable" advanced)) :group 'wdired) +(defcustom wdired-keep-marker-rename t + ;; Use t as default so that renamed files "take their markers with them". + "Controls marking of files renamed in WDired. +If t, files keep their previous marks when they are renamed. +If a character, renamed files (whether previously marked or not) +are afterward marked with that character. +This option affects only files renamed by `wdired-finish-edit'. +See `dired-keep-marker-rename' if you want to do the same for files +renamed by `dired-do-rename' and `dired-do-rename-regexp'." + :type '(choice (const :tag "Keep" t) + (character :tag "Mark" :value ?R)) + :version "24.3" + :group 'wdired) + (defvar wdired-mode-map (let ((map (make-sparse-keymap))) (define-key map "\C-x\C-s" 'wdired-finish-edit) @@ -416,6 +430,8 @@ non-nil means return old filename." (set-buffer-modified-p nil) (setq buffer-undo-list nil)) +(declare-function dired-add-entry "dired-aux" (filename &optional marker-char relative)) + (defun wdired-do-renames (renames) "Perform RENAMES in parallel." (let ((residue ()) @@ -471,9 +487,12 @@ non-nil means return old filename." (dired-rename-file file-ori file-new overwrite) (dired-remove-file file-ori) - (dired-add-file file-new (if (integerp dired-keep-marker-rename) - dired-keep-marker-rename - old-mark))) + (dired-add-file + file-new + (cond ((integerp wdired-keep-marker-rename) + wdired-keep-marker-rename) + (wdired-keep-marker-rename old-mark) + (t nil)))) (error (setq errors (1+ errors)) (dired-log (concat "Rename `" file-ori "' to `" From d069271c256aa0b4e6bee71a5995c36d20030cd5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Oct 2012 11:54:04 +0200 Subject: [PATCH 056/109] Fix help-echo text in profiler-report-make-entry-part. lisp/profiler.el (profiler-report-make-entry-part): Fix help-echo text to match the real keybindings. --- lisp/ChangeLog | 5 +++++ lisp/profiler.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c6e940ba0fa..d7349617d58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-27 Eli Zaretskii + + * profiler.el (profiler-report-make-entry-part): Fix help-echo + text to match the real keybindings. + 2012-10-27 Juri Linkov * wdired.el (wdired-keep-marker-rename): New defcustom. 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.") (propertize (symbol-name entry) 'face 'link 'mouse-face 'highlight - 'help-echo "mouse-2 or RET jumps to definition")) + 'help-echo "\ +mouse-2: jump to definition\n\ +RET: expand or collapse")) (t (profiler-format-entry entry))))) (propertize string 'profiler-entry entry))) From caa5e5a44dd23b77dfc38f7dd8b63af241149410 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 27 Oct 2012 13:06:08 +0200 Subject: [PATCH 057/109] Fix typo in screen.texi. --- doc/emacs/ChangeLog | 4 ++++ doc/emacs/screen.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index edfbecf9634..3c21a60394a 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2012-10-27 Bastien Guerry + + * screen.texi (Menu Bar): Fix typo. + 2012-10-27 Chong Yidong * frames.texi (Mouse Avoidance): Mention new variable 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 the menu to different items, and then you can type @key{RET} to select the item. Each menu item is also designated by a letter or digit (usually the initial of some word in the item's name). This letter or -digit is separated from the item name by @samp{=>}. You can type the +digit is separated from the item name by @samp{==>}. You can type the item's letter or digit to select the item. From 6c16c13ed185acf16dc8f1c6ba458f1e59328e84 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Oct 2012 13:21:26 +0200 Subject: [PATCH 058/109] Fix w32 implementation of itimers: overflow and ITIMER_PROF. Avoid overflow in w32 implementation of interval timers. When possible, for ITIMER_PROF count only times the main thread actually executes. src/w32proc.c : 'expire' and 'reload' are now ULONGLONG types. Likewise for all the other data which was previously clock_t. (GetThreadTimes_Proc): New typedef. (w32_get_timer_time): New function, returns a suitable time value for the timer. (timer_loop): Enter critical section when accessing ULONGLONG values of the itimer_data struct, as these accesses are no longer atomic. Call 'w32_get_timer_time' instead of 'clock'. (init_timers): Initialize s_pfn_Get_Thread_Times. (start_timer_thread): Don't assign itimer->caller_thread here. (getitimer): Assign itimer->caller_thread here. (setitimer): Always call getitimer to get the value of ticks_now. --- src/ChangeLog | 19 ++++++ src/w32proc.c | 177 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 147 insertions(+), 49 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index bf519556334..2efebc6754d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,22 @@ +2012-10-27 Eli Zaretskii + + Avoid overflow in w32 implementation of interval timers. When + possible, for ITIMER_PROF count only times the main thread + actually executes. + * w32proc.c : 'expire' and 'reload' are now + ULONGLONG types. Likewise for all the other data which was + previously clock_t. + (GetThreadTimes_Proc): New typedef. + (w32_get_timer_time): New function, returns a suitable time value + for the timer. + (timer_loop): Enter critical section when accessing ULONGLONG + values of the itimer_data struct, as these accesses are no longer + atomic. Call 'w32_get_timer_time' instead of 'clock'. + (init_timers): Initialize s_pfn_Get_Thread_Times. + (start_timer_thread): Don't assign itimer->caller_thread here. + (getitimer): Assign itimer->caller_thread here. + (setitimer): Always call getitimer to get the value of ticks_now. + 2012-10-26 Eli Zaretskii * w32fns.c (w32_wnd_proc) : Don't enable tracking of diff --git a/src/w32proc.c b/src/w32proc.c index 57b3860cb76..fe3bbde167c 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -244,28 +244,89 @@ setpgrp (int pid, int gid) the thread calls the appropriate signal handler when the timer expires, after stopping the thread which installed the timer. */ -/* FIXME: clock_t counts overflow after 49 days, need to handle the - wrap-around. */ struct itimer_data { - clock_t expire; - clock_t reload; + ULONGLONG expire; + ULONGLONG reload; int terminate; int type; HANDLE caller_thread; HANDLE timer_thread; }; -static clock_t ticks_now; +static ULONGLONG ticks_now; static struct itimer_data real_itimer, prof_itimer; -static clock_t clocks_min; +static ULONGLONG clocks_min; /* If non-zero, itimers are disabled. Used during shutdown, when we delete the critical sections used by the timer threads. */ static int disable_itimers; static CRITICAL_SECTION crit_real, crit_prof; +/* GetThreadTimes is not available on Windows 9X and posibly also on 2K. */ +typedef BOOL (WINAPI *GetThreadTimes_Proc) ( + HANDLE hThread, + LPFILETIME lpCreationTime, + LPFILETIME lpExitTime, + LPFILETIME lpKernelTime, + LPFILETIME lpUserTime); + +static GetThreadTimes_Proc s_pfn_Get_Thread_Times; + +/* Return a suitable time value, in 1-ms units, for THREAD, a handle + to a thread. If THREAD is NULL or an invalid handle, return the + current wall-clock time since January 1, 1601 (UTC). Otherwise, + return the sum of kernel and user times used by THREAD since it was + created, plus its creation time. */ +static ULONGLONG +w32_get_timer_time (HANDLE thread) +{ + ULONGLONG retval; + int use_system_time = 1; + + if (thread && thread != INVALID_HANDLE_VALUE + && s_pfn_Get_Thread_Times != NULL) + { + FILETIME creation_ftime, exit_ftime, kernel_ftime, user_ftime; + ULARGE_INTEGER temp_creation, temp_kernel, temp_user; + + if (s_pfn_Get_Thread_Times (thread, &creation_ftime, &exit_ftime, + &kernel_ftime, &user_ftime)) + { + use_system_time = 0; + temp_creation.LowPart = creation_ftime.dwLowDateTime; + temp_creation.HighPart = creation_ftime.dwHighDateTime; + temp_kernel.LowPart = kernel_ftime.dwLowDateTime; + temp_kernel.HighPart = kernel_ftime.dwHighDateTime; + temp_user.LowPart = user_ftime.dwLowDateTime; + temp_user.HighPart = user_ftime.dwHighDateTime; + retval = + temp_creation.QuadPart / 10000 + temp_kernel.QuadPart / 10000 + + temp_user.QuadPart / 10000; + } + else + DebPrint (("GetThreadTimes failed with error code %lu\n", + GetLastError ())); + } + + if (use_system_time) + { + FILETIME current_ftime; + ULARGE_INTEGER temp; + + GetSystemTimeAsFileTime (¤t_ftime); + + temp.LowPart = current_ftime.dwLowDateTime; + temp.HighPart = current_ftime.dwHighDateTime; + + retval = temp.QuadPart / 10000; + } + + return retval; +} + #define MAX_SINGLE_SLEEP 30 +/* Thread function for a timer thread. */ static DWORD WINAPI timer_loop (LPVOID arg) { @@ -275,12 +336,13 @@ timer_loop (LPVOID arg) CRITICAL_SECTION *crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / CLOCKS_PER_SEC; int new_count = 0; + HANDLE hth = (which == ITIMER_REAL) ? NULL : itimer->caller_thread; while (1) { DWORD sleep_time; signal_handler handler; - clock_t now, expire, reload; + ULONGLONG now, expire, reload; /* Load new values if requested by setitimer. */ EnterCriticalSection (crit); @@ -290,15 +352,14 @@ timer_loop (LPVOID arg) if (itimer->terminate) return 0; - if (itimer->expire == 0) + if (expire == 0) { /* We are idle. */ Sleep (max_sleep); continue; } - expire = itimer->expire; - if (expire > (now = clock ())) + if (expire > (now = w32_get_timer_time (hth))) sleep_time = expire - now; else sleep_time = 0; @@ -309,8 +370,11 @@ timer_loop (LPVOID arg) if (itimer->terminate) return 0; Sleep (max_sleep); + EnterCriticalSection (crit); expire = itimer->expire; - sleep_time = (expire > (now = clock ())) ? expire - now : 0; + LeaveCriticalSection (crit); + sleep_time = + (expire > (now = w32_get_timer_time (hth))) ? expire - now : 0; } if (itimer->terminate) return 0; @@ -320,13 +384,16 @@ timer_loop (LPVOID arg) /* Always sleep past the expiration time, to make sure we never call the handler _before_ the expiration time, always slightly after it. Sleep(5) makes sure we don't - hog the CPU by calling 'clock' with high frequency, and - also let other threads work. */ - while (clock () < expire) + hog the CPU by calling 'w32_get_timer_time' with high + frequency, and also let other threads work. */ + while (w32_get_timer_time (hth) < expire) Sleep (5); } - if (itimer->expire == 0) + EnterCriticalSection (crit); + expire = itimer->expire; + LeaveCriticalSection (crit); + if (expire == 0) continue; /* Time's up. */ @@ -353,19 +420,21 @@ timer_loop (LPVOID arg) ResumeThread (itimer->caller_thread); } - if (itimer->expire == 0) - continue; - /* Update expiration time and loop. */ EnterCriticalSection (crit); expire = itimer->expire; + if (expire == 0) + { + LeaveCriticalSection (crit); + continue; + } reload = itimer->reload; if (reload > 0) { - now = clock (); + now = w32_get_timer_time (hth); if (expire <= now) { - clock_t lag = now - expire; + ULONGLONG lag = now - expire; /* If we missed some opportunities (presumably while sleeping or while the signal handler ran), skip @@ -448,6 +517,15 @@ term_timers (void) void init_timers (void) { + /* GetThreadTimes is not avaiulable on all versions of Windows, so + need to probe for its availability dynamically, and call it + through a pointer. */ + s_pfn_Get_Thread_Times = NULL; /* in case dumped Emacs comes with a value */ + if (os_subtype != OS_9X) + s_pfn_Get_Thread_Times = + (GetThreadTimes_Proc)GetProcAddress (GetModuleHandle ("kernel32.dll"), + "GetThreadTimes"); + /* Make sure we start with zeroed out itimer structures, since dumping may have left there traces of threads long dead. */ memset (&real_itimer, 0, sizeof real_itimer); @@ -473,14 +551,6 @@ start_timer_thread (int which) return 0; /* Start a new thread. */ - if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), - GetCurrentProcess (), &itimer->caller_thread, 0, - FALSE, DUPLICATE_SAME_ACCESS)) - { - errno = ESRCH; - return -1; - } - itimer->terminate = 0; itimer->type = which; /* Request that no more than 64KB of stack be reserved for this @@ -512,17 +582,16 @@ start_timer_thread (int which) int getitimer (int which, struct itimerval *value) { - volatile clock_t *t_expire; - volatile clock_t *t_reload; - clock_t expire, reload; + volatile ULONGLONG *t_expire; + volatile ULONGLONG *t_reload; + ULONGLONG expire, reload; __int64 usecs; CRITICAL_SECTION *crit; + struct itimer_data *itimer; if (disable_itimers) return -1; - ticks_now = clock (); - if (!value) { errno = EFAULT; @@ -535,8 +604,22 @@ getitimer (int which, struct itimerval *value) return -1; } - t_expire = (which == ITIMER_REAL) ? &real_itimer.expire: &prof_itimer.expire; - t_reload = (which == ITIMER_REAL) ? &real_itimer.reload: &prof_itimer.reload; + itimer = (which == ITIMER_REAL) ? &real_itimer : &prof_itimer; + + if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), + GetCurrentProcess (), &itimer->caller_thread, 0, + FALSE, DUPLICATE_SAME_ACCESS)) + { + errno = ESRCH; + return -1; + } + + ticks_now = w32_get_timer_time ((which == ITIMER_REAL) + ? NULL + : itimer->caller_thread); + + t_expire = &itimer->expire; + t_reload = &itimer->reload; crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; EnterCriticalSection (crit); @@ -560,10 +643,11 @@ getitimer (int which, struct itimerval *value) int setitimer(int which, struct itimerval *value, struct itimerval *ovalue) { - volatile clock_t *t_expire, *t_reload; - clock_t expire, reload, expire_old, reload_old; + volatile ULONGLONG *t_expire, *t_reload; + ULONGLONG expire, reload, expire_old, reload_old; __int64 usecs; CRITICAL_SECTION *crit; + struct itimerval tem, *ptem; if (disable_itimers) return -1; @@ -573,26 +657,21 @@ setitimer(int which, struct itimerval *value, struct itimerval *ovalue) time we are called, measure the clock tick resolution. */ if (!clocks_min) { - clock_t t1, t2; + ULONGLONG t1, t2; - for (t1 = clock (); (t2 = clock ()) == t1; ) + for (t1 = w32_get_timer_time (NULL); + (t2 = w32_get_timer_time (NULL)) == t1; ) ; clocks_min = t2 - t1; } if (ovalue) - { - if (getitimer (which, ovalue)) /* also sets ticks_now */ - return -1; /* errno already set */ - } + ptem = ovalue; else - ticks_now = clock (); + ptem = &tem; - if (which != ITIMER_REAL && which != ITIMER_PROF) - { - errno = EINVAL; - return -1; - } + if (getitimer (which, ptem)) /* also sets ticks_now */ + return -1; /* errno already set */ t_expire = (which == ITIMER_REAL) ? &real_itimer.expire : &prof_itimer.expire; From 15cc05e98486f43b21aaf6e7428fa9f08ddd9e94 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Oct 2012 21:20:02 +0200 Subject: [PATCH 059/109] Fix a typo in a comment. --- src/w32proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/w32proc.c b/src/w32proc.c index fe3bbde167c..6accf2224c5 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -262,7 +262,7 @@ static int disable_itimers; static CRITICAL_SECTION crit_real, crit_prof; -/* GetThreadTimes is not available on Windows 9X and posibly also on 2K. */ +/* GetThreadTimes is not available on Windows 9X and possibly also on 2K. */ typedef BOOL (WINAPI *GetThreadTimes_Proc) ( HANDLE hThread, LPFILETIME lpCreationTime, From 2e612797ce51736ccdcd1076b3d0f36eb4c17182 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Oct 2012 21:32:30 +0200 Subject: [PATCH 060/109] Use 'volatile' types for communications between timer thread and main thread. --- src/ChangeLog | 4 ++-- src/w32proc.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2efebc6754d..398d19fe6f2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,8 +4,8 @@ possible, for ITIMER_PROF count only times the main thread actually executes. * w32proc.c : 'expire' and 'reload' are now - ULONGLONG types. Likewise for all the other data which was - previously clock_t. + 'volatile ULONGLONG' types. All the other data which was + previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'. (GetThreadTimes_Proc): New typedef. (w32_get_timer_time): New function, returns a suitable time value for the timer. diff --git a/src/w32proc.c b/src/w32proc.c index 6accf2224c5..af656f915c7 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -245,9 +245,9 @@ setpgrp (int pid, int gid) expires, after stopping the thread which installed the timer. */ struct itimer_data { - ULONGLONG expire; - ULONGLONG reload; - int terminate; + volatile ULONGLONG expire; + volatile ULONGLONG reload; + volatile int terminate; int type; HANDLE caller_thread; HANDLE timer_thread; From 2f246cd3c8959abeaad76a7cd442dd20d69fb1a0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Oct 2012 21:43:48 +0200 Subject: [PATCH 061/109] Fix compiler warnings in w32proc.c. src/w32proc.c (sys_spawnve): Avoid compiler warning about format mismatch. (timer_loop): Remove unused variable. --- src/ChangeLog | 4 +++- src/w32proc.c | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 398d19fe6f2..7f036761011 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -11,11 +11,13 @@ for the timer. (timer_loop): Enter critical section when accessing ULONGLONG values of the itimer_data struct, as these accesses are no longer - atomic. Call 'w32_get_timer_time' instead of 'clock'. + atomic. Call 'w32_get_timer_time' instead of 'clock'. Remove + unused variable. (init_timers): Initialize s_pfn_Get_Thread_Times. (start_timer_thread): Don't assign itimer->caller_thread here. (getitimer): Assign itimer->caller_thread here. (setitimer): Always call getitimer to get the value of ticks_now. + (sys_spawnve): Avoid compiler warning about format mismatch. 2012-10-26 Eli Zaretskii diff --git a/src/w32proc.c b/src/w32proc.c index af656f915c7..e2187d52425 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -335,7 +335,6 @@ timer_loop (LPVOID arg) int sig = (which == ITIMER_REAL) ? SIGALRM : SIGPROF; CRITICAL_SECTION *crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / CLOCKS_PER_SEC; - int new_count = 0; HANDLE hth = (which == ITIMER_REAL) ? NULL : itimer->caller_thread; while (1) @@ -1656,7 +1655,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) numenv++; } /* extra env vars... */ - sprintf (ppid_env_var_buffer, "EM_PARENT_PROCESS_ID=%d", + sprintf (ppid_env_var_buffer, "EM_PARENT_PROCESS_ID=%lu", GetCurrentProcessId ()); arglen += strlen (ppid_env_var_buffer) + 1; numenv++; From 5b6887ad2afbdd7c1d855bbea36e2faeef2ad9b9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 27 Oct 2012 15:07:43 -0700 Subject: [PATCH 062/109] * doc/lispref/lists.texi (List Elements): Typo fix. --- doc/lispref/ChangeLog | 4 ++++ doc/lispref/lists.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index c7fb29a6fb1..03922f2c02f 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2012-10-27 Glenn Morris + + * lists.texi (List Elements): Typo fix. + 2012-10-27 Chong Yidong * minibuf.texi (High-Level Completion): Don't mention removed diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 4a8740a5734..eaef8cc1f8a 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -252,7 +252,7 @@ x @end example @noindent -For the @code{pop} macro, which removes an element from a list, +For the @code{push} macro, which adds an element to a list, @xref{List Variables}. @end defmac From 5887564d5b5c90a1bc2ff7c0a3412cb6f765d03e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 27 Oct 2012 15:42:07 -0700 Subject: [PATCH 063/109] Move generalized variable documentation from misc/cl.texi to lispref * doc/lispref/variables.texi (Generalized Variables): New section, adapted from misc/cl.texi. * doc/lispref/elisp.texi (Top): Add Generalized Variables to menu. * doc/lispref/lists.texi (List Elements, List Variables): Mention generalized variables. * doc/misc/cl.texi (Control Structure): Update for setf now being in core. (Setf Extensions): Rename from Basic Setf. Move much of the former content to lispref/variables.texi. (Modify Macros): Move pop, push details to lispref/variables.texi. (Customizing Setf): Copyedits for setf etc being in core. (Modify Macros, Efficiency Concerns, Porting Common Lisp): Further namespaces updates. --- doc/lispref/ChangeLog | 6 + doc/lispref/elisp.texi | 1 + doc/lispref/lists.texi | 8 ++ doc/lispref/variables.texi | 103 ++++++++++++++++ doc/misc/ChangeLog | 10 ++ doc/misc/cl.texi | 235 +++++++++++++------------------------ 6 files changed, 209 insertions(+), 154 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 03922f2c02f..aea26248452 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,5 +1,11 @@ 2012-10-27 Glenn Morris + * variables.texi (Generalized Variables): New section, + adapted from misc/cl.texi. + * elisp.texi (Top): Add Generalized Variables to menu. + * lists.texi (List Elements, List Variables): + Mention generalized variables. + * lists.texi (List Elements): Typo fix. 2012-10-27 Chong Yidong diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 1d1dab8faac..06a2ebfcaf8 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -486,6 +486,7 @@ Variables * Variable Aliases:: Variables that are aliases for other variables. * Variables with Restricted Values:: Non-constant variables whose value can @emph{not} be an arbitrary Lisp object. +* Generalized Variables:: Extending the concept of variables. Scoping Rules for Variable Bindings diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index eaef8cc1f8a..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 @defmac pop listname This macro is a way of examining the @sc{car} of a list, and taking it off the list, all at once. +@c FIXME I don't think is a particularly good way to do it, +@c but generalized variables have not been introduced yet. +(In fact, this macro can act on generalized variables, not just lists. +@xref{Generalized Variables}.) It operates on the list which is stored in the symbol @var{listname}. It removes this element from the list by setting @var{listname} @@ -682,6 +686,10 @@ to modify a list which is stored in a variable. @defmac push newelt listname This macro provides an alternative way to write @code{(setq @var{listname} (cons @var{newelt} @var{listname}))}. +@c FIXME I don't think is a particularly good way to do it, +@c but generalized variables have not been introduced yet. +(In fact, this macro can act on generalized variables, not just lists. +@xref{Generalized Variables}.) @example (setq l '(a b)) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 1c0abcb8e66..1ffb1f7ffcb 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -41,6 +41,7 @@ representing the variable. * Variable Aliases:: Variables that are aliases for other variables. * Variables with Restricted Values:: Non-constant variables whose value can @emph{not} be an arbitrary Lisp object. +* Generalized Variables:: Extending the concept of variables. @end menu @node Global Variables @@ -1946,3 +1947,105 @@ Attempting to assign them any other value will result in an error: (setq undo-limit 1000.0) @error{} Wrong type argument: integerp, 1000.0 @end example + +@c FIXME? Not sure this is the right place for this section. +@node Generalized Variables +@section Generalized Variables + +A @dfn{generalized variable} or @dfn{place form} is one of the many places +in Lisp memory where values can be stored. The simplest place form is +a regular Lisp variable. But the @sc{car}s and @sc{cdr}s of lists, elements +of arrays, properties of symbols, and many other locations are also +places where Lisp values are stored. + +@c FIXME? Not sure this is a useful analogy... +Generalized variables are analogous to ``lvalues'' in the C +language, where @samp{x = a[i]} gets an element from an array +and @samp{a[i] = x} stores an element using the same notation. +Just as certain forms like @code{a[i]} can be lvalues in C, there +is a set of forms that can be generalized variables in Lisp. + +The @code{setf} macro is the most basic way to operate on generalized +variables. The @code{setf} form is like @code{setq}, except that it +accepts arbitrary place forms on the left side rather than just +symbols. For example, @code{(setf (car a) b)} sets the car of +@code{a} to @code{b}, doing the same operation as @code{(setcar a b)}, +but without having to remember two separate functions for setting and +accessing every type of place. + +@defmac setf [place form]@dots{} +This macro evaluates @var{form} and stores it in @var{place}, which +must be a valid generalized variable form. If there are several +@var{place} and @var{form} pairs, the assignments are done sequentially +just as with @code{setq}. @code{setf} returns the value of the last +@var{form}. +@end defmac + +The following Lisp forms will work as generalized variables, and +so may appear in the @var{place} argument of @code{setf}: + +@itemize +@item +A symbol naming a variable. In other words, @code{(setf x y)} is +exactly equivalent to @code{(setq x y)}, and @code{setq} itself is +strictly speaking redundant given that @code{setf} exists. Many +programmers continue to prefer @code{setq} for setting simple +variables, though, purely for stylistic or historical reasons. +The macro @code{(setf x y)} actually expands to @code{(setq x y)}, +so there is no performance penalty for using it in compiled code. + +@item +A call to any of the following standard Lisp functions: + +@smallexample +car cdr nth nthcdr +caar cadr cdar cddr +aref elt get gethash +symbol-function symbol-value symbol-plist +@end smallexample + +@item +The following Emacs-specific functions are also @code{setf}-able: + +@smallexample +default-value process-get +frame-parameter process-sentinel +terminal-parameter window-buffer +keymap-parent window-display-table +match-data window-dedicated-p +overlay-get window-hscroll +overlay-start window-parameter +overlay-end window-point +process-buffer window-start +process-filter +@end smallexample +@end itemize + +@noindent +Using any forms other than these in the @var{place} argument to +@code{setf} will signal an error. + +Note that for @code{nthcdr} and @code{getf}, the list argument +of the function must itself be a valid @var{place} form. For +example, @code{(setf (nthcdr 0 foo) 7)} will set @code{foo} itself +to 7. +@c The use of @code{nthcdr} as a @var{place} form is an extension +@c to standard Common Lisp. + +@c FIXME I don't think is a particularly good way to do it, +@c but these macros are introduced before gvs are. +The macros @code{push} (@pxref{List Variables}) and @code{pop} +(@pxref{List Elements}) can manipulate generalized variables, +not just lists. @code{(pop @var{place})} removes and returns the first +element of the list stored in @var{place}. It is analogous to +@code{(prog1 (car @var{place}) (setf @var{place} (cdr @var{place})))}, +except that it takes care to evaluate all subforms only once. +@code{(push @var{x} @var{place})} inserts @var{x} at the front of +the list stored in @var{place}. It is analogous to @code{(setf +@var{place} (cons @var{x} @var{place}))}, except for evaluation of the +subforms. Note that @code{push} and @code{pop} on an @code{nthcdr} +place can be used to insert or delete at any position in a list. + +The @file{cl-lib} library defines various extensions for generalized +variables, including additional @code{setf} places. +@xref{Generalized Variables,,, cl, Common Lisp Extensions}. diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index a0cfd675f0a..d447b0ca1ff 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,13 @@ +2012-10-27 Glenn Morris + + * cl.texi (Control Structure): Update for setf now being in core. + (Setf Extensions): Rename from Basic Setf. Move much of the + former content to lispref/variables.texi. + (Modify Macros): Move pop, push details to lispref/variables.texi. + (Customizing Setf): Copyedits for setf etc being in core. + (Modify Macros, Efficiency Concerns, Porting Common Lisp): + Further namespaces updates. + 2012-10-26 Bastien Guerry * org.texi (Installation): Update the link to Org's ELPA. Also diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 9200958a1b5..aba3f244012 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -57,7 +57,7 @@ developing GNU and promoting software freedom.'' * Overview:: Basics, usage, etc. * Program Structure:: Arglists, @code{cl-eval-when}, @code{defalias}. * Predicates:: @code{cl-typep} and @code{cl-equalp}. -* Control Structure:: @code{setf}, @code{cl-do}, @code{cl-loop}, etc. +* Control Structure:: @code{cl-do}, @code{cl-loop}, etc. * Macros:: Destructuring, @code{cl-define-compiler-macro}. * Declarations:: @code{cl-proclaim}, @code{cl-declare}, etc. * Symbols:: Property lists, @code{cl-gensym}. @@ -801,17 +801,16 @@ In Emacs, use @code{memq} (or @code{cl-member}) and @code{assq} (or @noindent The features described in the following sections implement -various advanced control structures, including the powerful -@c FIXME setf is now in gv.el, not cl. -@code{setf} facility and a number of looping and conditional +various advanced control structures, including extensions to the +standard @code{setf} facility, and a number of looping and conditional constructs. -@c FIXME setf, push are standard now. +@c FIXME @c lexical-let is obsolete; flet is not cl-flet. @c values is not cl-values. @menu * Assignment:: The @code{cl-psetq} form. -* Generalized Variables:: @code{setf}, @code{cl-incf}, @code{push}, etc. +* Generalized Variables:: Extensions to generalized variables. * Variable Bindings:: @code{cl-progv}, @code{lexical-let}, @code{flet}, @code{cl-macrolet}. * Conditionals:: @code{cl-case}, @code{cl-typecase}. * Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}. @@ -857,130 +856,74 @@ provides an even more convenient way to swap two variables; @code{cl-psetq} always returns @code{nil}. @end defspec -@c FIXME now in gv.el. @node Generalized Variables @section Generalized Variables -@noindent -A ``generalized variable'' or ``place form'' is one of the many places -in Lisp memory where values can be stored. The simplest place form is -a regular Lisp variable. But the cars and cdrs of lists, elements -of arrays, properties of symbols, and many other locations are also -places where Lisp values are stored. - -The @code{setf} form is like @code{setq}, except that it accepts -arbitrary place forms on the left side rather than just -symbols. For example, @code{(setf (car a) b)} sets the car of -@code{a} to @code{b}, doing the same operation as @code{(setcar a b)} -but without having to remember two separate functions for setting -and accessing every type of place. - -Generalized variables are analogous to ``lvalues'' in the C -language, where @samp{x = a[i]} gets an element from an array -and @samp{a[i] = x} stores an element using the same notation. -Just as certain forms like @code{a[i]} can be lvalues in C, there -is a set of forms that can be generalized variables in Lisp. +A @dfn{generalized variable} or @dfn{place form} is one of the many +places in Lisp memory where values can be stored. The simplest place +form is a regular Lisp variable. But the cars and cdrs of lists, +elements of arrays, properties of symbols, and many other locations +are also places where Lisp values are stored. For basic information, +@pxref{Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}. +This package provides several additional features related to +generalized variables. @menu -* Basic Setf:: @code{setf} and place forms. -* Modify Macros:: @code{cl-incf}, @code{push}, @code{cl-rotatef}, @code{letf}, @code{cl-callf}, etc. +* Setf Extensions:: Additional @code{setf} places. +* Modify Macros:: @code{cl-incf}, @code{cl-rotatef}, @code{letf}, @code{cl-callf}, etc. * Customizing Setf:: @code{define-modify-macro}, @code{defsetf}, @code{define-setf-method}. @end menu -@node Basic Setf -@subsection Basic Setf +@node Setf Extensions +@subsection Setf Extensions -@noindent -The @code{setf} macro is the most basic way to operate on generalized -variables. +Several standard (e.g. @code{car}) and Emacs-specific +(e.g. @code{window-point}) Lisp functions are @code{setf}-able by default. +This package defines @code{setf} handlers for several additional functions: -@defspec setf [place form]@dots{} -This macro evaluates @var{form} and stores it in @var{place}, which -must be a valid generalized variable form. If there are several -@var{place} and @var{form} pairs, the assignments are done sequentially -just as with @code{setq}. @code{setf} returns the value of the last -@var{form}. - -The following Lisp forms will work as generalized variables, and -so may appear in the @var{place} argument of @code{setf}: - -@itemize @bullet +@itemize @item -A symbol naming a variable. In other words, @code{(setf x y)} is -exactly equivalent to @code{(setq x y)}, and @code{setq} itself is -strictly speaking redundant now that @code{setf} exists. Many -programmers continue to prefer @code{setq} for setting simple -variables, though, purely for stylistic or historical reasons. -The macro @code{(setf x y)} actually expands to @code{(setq x y)}, -so there is no performance penalty for using it in compiled code. - -@item -A call to any of the following Lisp functions: - +Functions from @code{CL} itself: @smallexample -car cdr caar .. cddddr -nth rest first .. tenth -aref elt nthcdr -symbol-function symbol-value symbol-plist -get get* getf -gethash subseq +cl-caaar .. cl-cddddr cl-first .. cl-tenth +cl-rest cl-get cl-getf cl-subseq @end smallexample -@noindent -Note that for @code{nthcdr} and @code{getf}, the list argument -of the function must itself be a valid @var{place} form. For -example, @code{(setf (nthcdr 0 foo) 7)} will set @code{foo} itself -to 7. Note that @code{push} and @code{pop} on an @code{nthcdr} -place can be used to insert or delete at any position in a list. -The use of @code{nthcdr} as a @var{place} form is an extension -to standard Common Lisp. - @item -The following Emacs-specific functions are also @code{setf}-able. - +General Emacs Lisp functions: @smallexample -buffer-file-name marker-position -buffer-modified-p match-data -buffer-name mouse-position -buffer-string overlay-end -buffer-substring overlay-get -current-buffer overlay-start -current-case-table point -current-column point-marker -current-global-map point-max -current-input-mode point-min -current-local-map process-buffer -current-window-configuration process-filter -default-file-modes process-sentinel -default-value read-mouse-position -documentation-property screen-height -extent-data screen-menubar -extent-end-position screen-width -extent-start-position selected-window -face-background selected-screen -face-background-pixmap selected-frame -face-font standard-case-table -face-foreground syntax-table -face-underline-p window-buffer -file-modes window-dedicated-p -frame-height window-display-table -frame-parameters window-height -frame-visible-p window-hscroll -frame-width window-point -get-register window-start -getenv window-width -global-key-binding x-get-secondary-selection -keymap-parent x-get-selection -local-key-binding -mark -mark-marker +buffer-file-name getenv +buffer-modified-p global-key-binding +buffer-name local-key-binding +buffer-string mark +buffer-substring mark-marker +current-buffer marker-position +current-case-table mouse-position +current-column point +current-global-map point-marker +current-input-mode point-max +current-local-map point-min +current-window-configuration read-mouse-position +default-file-modes screen-height +documentation-property screen-width +face-background selected-window +face-background-pixmap selected-screen +face-font selected-frame +face-foreground standard-case-table +face-underline-p syntax-table +file-modes visited-file-modtime +frame-height window-height +frame-parameters window-width +frame-visible-p x-get-secondary-selection +frame-width x-get-selection +get-register @end smallexample Most of these have directly corresponding ``set'' functions, like @code{use-local-map} for @code{current-local-map}, or @code{goto-char} for @code{point}. A few, like @code{point-min}, expand to longer -sequences of code when they are @code{setf}'d (@code{(narrow-to-region -x (point-max))} in this case). +sequences of code when they are used with @code{setf} +(@code{(narrow-to-region x (point-max))} in this case). @item A call of the form @code{(substring @var{subplace} @var{n} [@var{m}])}, @@ -1007,6 +950,8 @@ a The generalized variable @code{buffer-substring}, listed above, also works in this way by replacing a portion of the current buffer. +@c FIXME? Also `eq'? (see cl-lib.el) + @item A call of the form @code{(apply '@var{func} @dots{})} or @code{(apply (function @var{func}) @dots{})}, where @var{func} @@ -1025,9 +970,9 @@ Any form for which a @code{defsetf} or @code{define-setf-method} has been made. @end itemize -Using any forms other than these in the @var{place} argument to -@code{setf} will signal an error. - +@c FIXME should this be in lispref? It seems self-evident. +@c Contrast with the cl-incf example later on. +@c Here it really only serves as a constrast to wrong-order. The @code{setf} macro takes care to evaluate all subforms in the proper left-to-right order; for example, @@ -1056,15 +1001,14 @@ will be preserved. Adapting an example from Steele, given the form @code{(setf (wrong-order @var{a} @var{b}) 17)} will evaluate @var{b} first, then @var{a}, just as in an actual call to @code{wrong-order}. -@end defspec @node Modify Macros @subsection Modify Macros @noindent -This package defines a number of other macros besides @code{setf} -that operate on generalized variables. Many are interesting and -useful even when the @var{place} is just a variable name. +This package defines a number of macros that operate on generalized +variables. Many are interesting and useful even when the @var{place} +is just a variable name. @defspec cl-psetf [place form]@dots{} This macro is to @code{setf} what @code{cl-psetq} is to @code{setq}: @@ -1080,8 +1024,8 @@ by @var{x} if specified. The incremented value is returned. For example, @code{(cl-incf i)} is equivalent to @code{(setq i (1+ i))}, and @code{(cl-incf (car x) 2)} is equivalent to @code{(setcar x (+ (car x) 2))}. -Once again, care is taken to preserve the ``apparent'' order of -evaluation. For example, +As with @code{setf}, care is taken to preserve the ``apparent'' order +of evaluation. For example, @example (cl-incf (aref vec (cl-incf i))) @@ -1120,21 +1064,6 @@ This macro decrements the number stored in @var{place} by one, or by @var{x} if specified. @end defspec -@c FIXME move to lispref, add generalized variables. -@defspec pop place -This macro removes and returns the first element of the list stored -in @var{place}. It is analogous to @code{(prog1 (car @var{place}) -(setf @var{place} (cdr @var{place})))}, except that it takes care -to evaluate all subforms only once. -@end defspec - -@c FIXME move to lispref, add generalized variables. -@defspec push x place -This macro inserts @var{x} at the front of the list stored in -@var{place}. It is analogous to @code{(setf @var{place} (cons -@var{x} @var{place}))}, except for evaluation of the subforms. -@end defspec - @defspec cl-pushnew x place @t{&key :test :test-not :key} This macro inserts @var{x} at the front of the list stored in @var{place}, but only if @var{x} was not @code{eql} to any @@ -1143,19 +1072,19 @@ are interpreted in the same way as for @code{cl-adjoin}. @xref{Lists as Sets}. @end defspec -@defspec shiftf place@dots{} newvalue +@defspec cl-shiftf place@dots{} newvalue This macro shifts the @var{place}s left by one, shifting in the value of @var{newvalue} (which may be any Lisp expression, not just a generalized variable), and returning the value shifted out of -the first @var{place}. Thus, @code{(shiftf @var{a} @var{b} @var{c} +the first @var{place}. Thus, @code{(cl-shiftf @var{a} @var{b} @var{c} @var{d})} is equivalent to @example (prog1 @var{a} - (psetf @var{a} @var{b} - @var{b} @var{c} - @var{c} @var{d})) + (cl-psetf @var{a} @var{b} + @var{b} @var{c} + @var{c} @var{d})) @end example @noindent @@ -1168,10 +1097,10 @@ This macro rotates the @var{place}s left by one in circular fashion. Thus, @code{(cl-rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to @example -(psetf @var{a} @var{b} - @var{b} @var{c} - @var{c} @var{d} - @var{d} @var{a}) +(cl-psetf @var{a} @var{b} + @var{b} @var{c} + @var{c} @var{d} + @var{d} @var{a}) @end example @noindent @@ -1318,9 +1247,8 @@ Most of the modify macros defined by Common Lisp do not exactly follow the pattern of @code{define-modify-macro}. For example, @code{push} takes its arguments in the wrong order, and @code{pop} is completely irregular. You can define these macros ``by hand'' -using @code{get-setf-method}, or consult the source file -@file{cl-macs.el} to see how to use the internal @code{setf} -building blocks. +using @code{get-setf-method}, or consult the source +to see how to use the internal @code{setf} building blocks. @end defspec @defspec defsetf access-fn update-fn @@ -4708,32 +4636,31 @@ user to modify @var{place}. @noindent Many of the advanced features of this package, such as @code{cl-defun}, -@code{cl-loop}, and @code{setf}, are implemented as Lisp macros. In +@code{cl-loop}, etc., are implemented as Lisp macros. In byte-compiled code, these complex notations will be expanded into equivalent Lisp code which is simple and efficient. For example, -the forms +the form @example (cl-incf i n) -(push x (car p)) @end example @noindent -are expanded at compile-time to the Lisp forms +is expanded at compile-time to the Lisp form @example (setq i (+ i n)) -(setcar p (cons x (car p))) @end example @noindent -which are the most efficient ways of doing these respective operations +which is the most efficient ways of doing this operation in Lisp. Thus, there is no performance penalty for using the more -readable @code{cl-incf} and @code{push} forms in your compiled code. +readable @code{cl-incf} form in your compiled code. @emph{Interpreted} code, on the other hand, must expand these macros every time they are executed. For this reason it is strongly recommended that code making heavy use of macros be compiled. +@c FIXME why are they not labelled as macros? (The features labeled ``Special Form'' instead of ``Function'' in this manual are macros.) A loop using @code{cl-incf} a hundred times will execute considerably faster if compiled, and will also @@ -4751,7 +4678,7 @@ all Lisp macros which appear in the form. The easiest way to use this function is to go to the @file{*scratch*} buffer and type, say, @example -(cl-prettyexpand '(loop for x below 10 collect x)) +(cl-prettyexpand '(cl-loop for x below 10 collect x)) @end example @noindent @@ -5104,7 +5031,7 @@ these forms: @example (let ((total 0)) (dolist (x my-list) (cl-incf total x)) total) -(loop for x in my-list sum x) +(cl-loop for x in my-list sum x) @end example While this would be mainly a stylistic choice in most Common Lisps, From e11174254bab35ec88a8dfb483bd49104773d051 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 27 Oct 2012 15:54:53 -0700 Subject: [PATCH 064/109] * doc/misc/cl.texi: Use defmac for macros rather than defspec. (Efficiency Concerns): Related copyedit. --- doc/misc/ChangeLog | 3 + doc/misc/cl.texi | 238 ++++++++++++++++++++++----------------------- 2 files changed, 121 insertions(+), 120 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index d447b0ca1ff..24d8f1cee25 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,5 +1,8 @@ 2012-10-27 Glenn Morris + * cl.texi: Use defmac for macros rather than defspec. + (Efficiency Concerns): Related copyedit. + * cl.texi (Control Structure): Update for setf now being in core. (Setf Extensions): Rename from Basic Setf. Move much of the former content to lispref/variables.texi. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index aba3f244012..09386e2c0c7 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -268,14 +268,14 @@ this package to implement Common Lisp argument lists seamlessly. Instead, this package defines alternates for several Lisp forms which you must use if you need Common Lisp argument lists. -@defspec cl-defun name arglist body... +@defmac cl-defun name arglist body... This form is identical to the regular @code{defun} form, except that @var{arglist} is allowed to be a full Common Lisp argument list. Also, the function body is enclosed in an implicit block called @var{name}; @pxref{Blocks and Exits}. -@end defspec +@end defmac -@defspec cl-defsubst name arglist body... +@defmac cl-defsubst name arglist body... This is just like @code{cl-defun}, except that the function that is defined is automatically proclaimed @code{inline}, i.e., calls to it may be expanded into in-line code by the byte compiler. @@ -285,9 +285,9 @@ works in all versions of Emacs, and also generates somewhat more efficient inline expansions. In particular, @code{cl-defsubst} arranges for the processing of keyword arguments, default values, etc., to be done at compile-time whenever possible. -@end defspec +@end defmac -@defspec cl-defmacro name arglist body... +@defmac cl-defmacro name arglist body... This is identical to the regular @code{defmacro} form, except that @var{arglist} is allowed to be a full Common Lisp argument list. The @code{&environment} keyword is supported as @@ -296,13 +296,13 @@ within destructured lists (see below); top-level @code{&whole} cannot be implemented with the current Emacs Lisp interpreter. The macro expander body is enclosed in an implicit block called @var{name}. -@end defspec +@end defmac -@defspec cl-function symbol-or-lambda +@defmac cl-function symbol-or-lambda This is identical to the regular @code{function} form, except that if the argument is a @code{lambda} form then that form may use a full Common Lisp argument list. -@end defspec +@end defmac Also, all forms (such as @code{cl-flet} and @code{cl-labels}) defined in this package that include @var{arglist}s in their syntax allow @@ -491,7 +491,7 @@ For example, the compiler effectively evaluates @code{defmacro} forms at compile-time so that later parts of the file can refer to the macros that are defined. -@defspec cl-eval-when (situations...) forms... +@defmac cl-eval-when (situations...) forms... This form controls when the body @var{forms} are evaluated. The @var{situations} list may contain any set of the symbols @code{compile}, @code{load}, and @code{eval} (or their long-winded @@ -563,7 +563,7 @@ to @code{(progn @dots{})} in all contexts. The compiler treats certain top-level forms, like @code{defmacro} (sort-of) and @code{require}, as if they were wrapped in @code{(cl-eval-when (compile load eval) @dots{})}. -@end defspec +@end defmac Emacs includes two special forms related to @code{cl-eval-when}. One of these, @code{eval-when-compile}, is not quite equivalent to @@ -573,7 +573,7 @@ The other form, @code{(eval-and-compile @dots{})}, is exactly equivalent to @samp{(cl-eval-when (compile load eval) @dots{})} and so is not itself defined by this package. -@defspec eval-when-compile forms... +@defmac eval-when-compile forms... The @var{forms} are evaluated at compile-time; at execution time, this form acts like a quoted constant of the resulting value. Used at top-level, @code{eval-when-compile} is just like @samp{eval-when @@ -582,9 +582,9 @@ allows code to be evaluated once at compile-time for efficiency or other reasons. This form is similar to the @samp{#.} syntax of true Common Lisp. -@end defspec +@end defmac -@defspec cl-load-time-value form +@defmac cl-load-time-value form The @var{form} is evaluated at load-time; at execution time, this form acts like a quoted constant of the resulting value. @@ -625,7 +625,7 @@ Byte-compiled, the above defun will result in the following code ", and loaded on: " --temp--)) @end example -@end defspec +@end defmac @node Predicates @chapter Predicates @@ -733,7 +733,7 @@ floats. In all other circumstances, @code{cl-coerce} signals an error. @end defun -@defspec cl-deftype name arglist forms... +@defmac cl-deftype name arglist forms... This macro defines a new type called @var{name}. It is similar to @code{defmacro} in many ways; when @var{name} is encountered as a type name, the body @var{forms} are evaluated and should @@ -761,7 +761,7 @@ unsigned-byte @equiv{} (integer 0 *) The last example shows how the Common Lisp @code{unsigned-byte} type specifier could be implemented if desired; this package does not implement @code{unsigned-byte} by default. -@end defspec +@end defmac The @code{cl-typecase} and @code{cl-check-type} macros also use type names. @xref{Conditionals}. @xref{Assertions}. The @code{cl-map}, @@ -826,7 +826,7 @@ constructs. The @code{cl-psetq} form is just like @code{setq}, except that multiple assignments are done in parallel rather than sequentially. -@defspec cl-psetq [symbol form]@dots{} +@defmac cl-psetq [symbol form]@dots{} This special form (actually a macro) is used to assign to several variables simultaneously. Given only one @var{symbol} and @var{form}, it has the same effect as @code{setq}. Given several @var{symbol} @@ -854,7 +854,7 @@ provides an even more convenient way to swap two variables; @pxref{Modify Macros}.) @code{cl-psetq} always returns @code{nil}. -@end defspec +@end defmac @node Generalized Variables @section Generalized Variables @@ -1010,15 +1010,15 @@ This package defines a number of macros that operate on generalized variables. Many are interesting and useful even when the @var{place} is just a variable name. -@defspec cl-psetf [place form]@dots{} +@defmac cl-psetf [place form]@dots{} This macro is to @code{setf} what @code{cl-psetq} is to @code{setq}: When several @var{place}s and @var{form}s are involved, the assignments take place in parallel rather than sequentially. Specifically, all subforms are evaluated from left to right, then all the assignments are done (in an undefined order). -@end defspec +@end defmac -@defspec cl-incf place &optional x +@defmac cl-incf place &optional x This macro increments the number stored in @var{place} by one, or by @var{x} if specified. The incremented value is returned. For example, @code{(cl-incf i)} is equivalent to @code{(setq i (1+ i))}, and @@ -1057,22 +1057,22 @@ the other generalized-variable macros. As a more Emacs-specific example of @code{cl-incf}, the expression @code{(cl-incf (point) @var{n})} is essentially equivalent to @code{(forward-char @var{n})}. -@end defspec +@end defmac -@defspec cl-decf place &optional x +@defmac cl-decf place &optional x This macro decrements the number stored in @var{place} by one, or by @var{x} if specified. -@end defspec +@end defmac -@defspec cl-pushnew x place @t{&key :test :test-not :key} +@defmac cl-pushnew x place @t{&key :test :test-not :key} This macro inserts @var{x} at the front of the list stored in @var{place}, but only if @var{x} was not @code{eql} to any existing element of the list. The optional keyword arguments are interpreted in the same way as for @code{cl-adjoin}. @xref{Lists as Sets}. -@end defspec +@end defmac -@defspec cl-shiftf place@dots{} newvalue +@defmac cl-shiftf place@dots{} newvalue This macro shifts the @var{place}s left by one, shifting in the value of @var{newvalue} (which may be any Lisp expression, not just a generalized variable), and returning the value shifted out of @@ -1090,9 +1090,9 @@ the first @var{place}. Thus, @code{(cl-shiftf @var{a} @var{b} @var{c} @noindent except that the subforms of @var{a}, @var{b}, and @var{c} are actually evaluated only once each and in the apparent order. -@end defspec +@end defmac -@defspec cl-rotatef place@dots{} +@defmac cl-rotatef place@dots{} This macro rotates the @var{place}s left by one in circular fashion. Thus, @code{(cl-rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to @@ -1107,12 +1107,12 @@ Thus, @code{(cl-rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to except for the evaluation of subforms. @code{cl-rotatef} always returns @code{nil}. Note that @code{(cl-rotatef @var{a} @var{b})} conveniently exchanges @var{a} and @var{b}. -@end defspec +@end defmac The following macros were invented for this package; they have no analogues in Common Lisp. -@defspec letf (bindings@dots{}) forms@dots{} +@defmac letf (bindings@dots{}) forms@dots{} This macro is analogous to @code{let}, but for generalized variables rather than just symbols. Each @var{binding} should be of the form @code{(@var{place} @var{value})}; the original contents of the @@ -1162,14 +1162,14 @@ entry to the @code{letf} form. The only exceptions are plain variables and calls to @code{symbol-value} and @code{symbol-function}. If the symbol is not bound on entry, it is simply made unbound by @code{makunbound} or @code{fmakunbound} on exit. -@end defspec +@end defmac -@defspec cl-letf* (bindings@dots{}) forms@dots{} +@defmac cl-letf* (bindings@dots{}) forms@dots{} This macro is to @code{letf} what @code{let*} is to @code{let}: It does the bindings in sequential rather than parallel order. -@end defspec +@end defmac -@defspec cl-callf @var{function} @var{place} @var{args}@dots{} +@defmac cl-callf @var{function} @var{place} @var{args}@dots{} This is the ``generic'' modify macro. It calls @var{function}, which should be an unquoted function name, macro name, or lambda. It passes @var{place} and @var{args} as arguments, and assigns the @@ -1186,14 +1186,14 @@ Some more examples: @xref{Customizing Setf}, for @code{define-modify-macro}, a way to create even more concise notations for modify macros. Note again that @code{cl-callf} is an extension to standard Common Lisp. -@end defspec +@end defmac -@defspec cl-callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} +@defmac cl-callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} This macro is like @code{cl-callf}, except that @var{place} is the @emph{second} argument of @var{function} rather than the first. For example, @code{(push @var{x} @var{place})} is equivalent to @code{(cl-callf2 cons @var{x} @var{place})}. -@end defspec +@end defmac The @code{cl-callf} and @code{cl-callf2} macros serve as building blocks for other macros like @code{cl-incf}, @code{cl-pushnew}, and @@ -1209,7 +1209,7 @@ Common Lisp defines three macros, @code{define-modify-macro}, @code{defsetf}, and @code{define-setf-method}, that allow the user to extend generalized variables in various ways. -@defspec define-modify-macro name arglist function [doc-string] +@defmac define-modify-macro name arglist function [doc-string] This macro defines a ``read-modify-write'' macro similar to @code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined to take a @var{place} argument followed by additional arguments @@ -1249,9 +1249,9 @@ follow the pattern of @code{define-modify-macro}. For example, is completely irregular. You can define these macros ``by hand'' using @code{get-setf-method}, or consult the source to see how to use the internal @code{setf} building blocks. -@end defspec +@end defmac -@defspec defsetf access-fn update-fn +@defmac defsetf access-fn update-fn This is the simpler of two @code{defsetf} forms. Where @var{access-fn} is the name of a function which accesses a place, this declares @var{update-fn} to be the corresponding store @@ -1294,9 +1294,9 @@ suite of setf methods, are: (defsetf symbol-value set) (defsetf buffer-name rename-buffer t) @end example -@end defspec +@end defmac -@defspec defsetf access-fn arglist (store-var) forms@dots{} +@defmac defsetf access-fn arglist (store-var) forms@dots{} This is the second, more complex, form of @code{defsetf}. It is rather like @code{defmacro} except for the additional @var{store-var} argument. The @var{forms} should return a Lisp form which stores @@ -1325,9 +1325,9 @@ Another example drawn from the standard package: (defsetf nth (n x) (store) (list 'setcar (list 'nthcdr n x) store)) @end example -@end defspec +@end defmac -@defspec define-setf-method access-fn arglist forms@dots{} +@defmac define-setf-method access-fn arglist forms@dots{} This is the most general way to create new place forms. When a @code{setf} to @var{access-fn} with arguments described by @var{arglist} is expanded, the @var{forms} are evaluated and @@ -1372,7 +1372,7 @@ by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which use this setf-method will optimize away most temporaries that turn out to be unnecessary, so there is little reason for the setf-method itself to optimize. -@end defspec +@end defmac @defun get-setf-method place &optional env This function returns the setf-method for @var{place}, by @@ -1435,7 +1435,7 @@ The standard @code{let} form binds variables whose names are known at compile-time. The @code{cl-progv} form provides an easy way to bind variables whose names are computed at run-time. -@defspec cl-progv symbols values forms@dots{} +@defmac cl-progv symbols values forms@dots{} This form establishes @code{let}-style variable bindings on a set of variables computed at run-time. The expressions @var{symbols} and @var{values} are evaluated, and must return lists @@ -1445,7 +1445,7 @@ If @var{values} is shorter than @var{symbols}, the last few symbols are bound to @code{nil}. If @var{symbols} is shorter than @var{values}, the excess values are ignored. -@end defspec +@end defmac @node Lexical Bindings @subsection Lexical Bindings @@ -1454,7 +1454,7 @@ are ignored. The @code{CL} package defines the following macro which more closely follows the Common Lisp @code{let} form: -@defspec lexical-let (bindings@dots{}) forms@dots{} +@defmac lexical-let (bindings@dots{}) forms@dots{} This form is exactly like @code{let} except that the bindings it establishes are purely lexical. Lexical bindings are similar to local variables in a language like C: Only the code physically @@ -1554,12 +1554,12 @@ instance of the lexical variable. The @code{lexical-let} form is an extension to Common Lisp. In true Common Lisp, all bindings are lexical unless declared otherwise. -@end defspec +@end defmac -@defspec lexical-let* (bindings@dots{}) forms@dots{} +@defmac lexical-let* (bindings@dots{}) forms@dots{} This form is just like @code{lexical-let}, except that the bindings are made sequentially in the manner of @code{let*}. -@end defspec +@end defmac @node Function Bindings @subsection Function Bindings @@ -1568,7 +1568,7 @@ are made sequentially in the manner of @code{let*}. These forms make @code{let}-like bindings to functions instead of variables. -@defspec flet (bindings@dots{}) forms@dots{} +@defmac flet (bindings@dots{}) forms@dots{} This form establishes @code{let}-style bindings on the function cells of symbols rather than on the value cells. Each @var{binding} must be a list of the form @samp{(@var{name} @var{arglist} @@ -1612,9 +1612,9 @@ Functions defined by @code{flet} may use the full Common Lisp argument notation supported by @code{cl-defun}; also, the function body is enclosed in an implicit block as if by @code{cl-defun}. @xref{Program Structure}. -@end defspec +@end defmac -@defspec labels (bindings@dots{}) forms@dots{} +@defmac labels (bindings@dots{}) forms@dots{} The @code{labels} form is like @code{flet}, except that it makes lexical bindings of the function names rather than dynamic bindings. (In true Common Lisp, both @code{flet} and @@ -1635,7 +1635,7 @@ functions. A ``reference'' to a function name is either a call to that function, or a use of its name quoted by @code{quote} or @code{function} to be passed on to, say, @code{mapcar}. -@end defspec +@end defmac @node Macro Bindings @subsection Macro Bindings @@ -1643,7 +1643,7 @@ function, or a use of its name quoted by @code{quote} or @noindent These forms create local macros and ``symbol macros''. -@defspec cl-macrolet (bindings@dots{}) forms@dots{} +@defmac cl-macrolet (bindings@dots{}) forms@dots{} This form is analogous to @code{flet}, but for macros instead of functions. Each @var{binding} is a list of the same form as the arguments to @code{cl-defmacro} (i.e., a macro name, argument list, @@ -1655,9 +1655,9 @@ scoped even in Emacs Lisp: The @code{cl-macrolet} binding will affect only calls that appear physically within the body @var{forms}, possibly after expansion of other macros in the body. -@end defspec +@end defmac -@defspec cl-symbol-macrolet (bindings@dots{}) forms@dots{} +@defmac cl-symbol-macrolet (bindings@dots{}) forms@dots{} This form creates @dfn{symbol macros}, which are macros that look like variable references rather than function calls. Each @var{binding} is a list @samp{(@var{var} @var{expansion})}; @@ -1723,7 +1723,7 @@ which in turn expands to @xref{Loop Facility}, for a description of the @code{cl-loop} macro. This package defines a nonstandard @code{in-ref} loop clause that works much like @code{my-dolist}. -@end defspec +@end defmac @node Conditionals @section Conditionals @@ -1732,7 +1732,7 @@ works much like @code{my-dolist}. These conditional forms augment Emacs Lisp's simple @code{if}, @code{and}, @code{or}, and @code{cond} forms. -@defspec cl-case keyform clause@dots{} +@defmac cl-case keyform clause@dots{} This macro evaluates @var{keyform}, then compares it with the key values listed in the various @var{clause}s. Whichever clause matches the key is executed; comparison is done by @code{eql}. If no clause @@ -1766,15 +1766,15 @@ a @key{RET} or @kbd{C-j}, or anything else. ((?\r ?\n) (do-ret-thing)) (t (do-other-thing))) @end example -@end defspec +@end defmac -@defspec cl-ecase keyform clause@dots{} +@defmac cl-ecase keyform clause@dots{} This macro is just like @code{cl-case}, except that if the key does not match any of the clauses, an error is signaled rather than simply returning @code{nil}. -@end defspec +@end defmac -@defspec cl-typecase keyform clause@dots{} +@defmac cl-typecase keyform clause@dots{} This macro is a version of @code{cl-case} that checks for types rather than values. Each @var{clause} is of the form @samp{(@var{type} @var{body}...)}. @xref{Type Predicates}, @@ -1791,13 +1791,13 @@ for a description of type specifiers. For example, The type specifier @code{t} matches any type of object; the word @code{otherwise} is also allowed. To make one clause match any of several types, use an @code{(or ...)} type specifier. -@end defspec +@end defmac -@defspec cl-etypecase keyform clause@dots{} +@defmac cl-etypecase keyform clause@dots{} This macro is just like @code{cl-typecase}, except that if the key does not match any of the clauses, an error is signaled rather than simply returning @code{nil}. -@end defspec +@end defmac @node Blocks and Exits @section Blocks and Exits @@ -1810,7 +1810,7 @@ in terms of @code{catch}; however, the lexical scoping allows the optimizing byte-compiler to omit the costly @code{catch} step if the body of the block does not actually @code{cl-return-from} the block. -@defspec cl-block name forms@dots{} +@defmac cl-block name forms@dots{} The @var{forms} are evaluated as if by a @code{progn}. However, if any of the @var{forms} execute @code{(cl-return-from @var{name})}, they will jump out and return directly from the @code{cl-block} form. @@ -1849,20 +1849,20 @@ not in fact contain any @code{cl-return} or @code{cl-return-from} calls that jump to it. This means that @code{cl-do} loops and @code{cl-defun} functions which don't use @code{cl-return} don't pay the overhead to support it. -@end defspec +@end defmac -@defspec cl-return-from name [result] +@defmac cl-return-from name [result] This macro returns from the block named @var{name}, which must be an (unevaluated) symbol. If a @var{result} form is specified, it is evaluated to produce the result returned from the @code{block}. Otherwise, @code{nil} is returned. -@end defspec +@end defmac -@defspec cl-return [result] +@defmac cl-return [result] This macro is exactly like @code{(cl-return-from nil @var{result})}. Common Lisp loops like @code{cl-do} and @code{cl-dolist} implicitly enclose themselves in @code{nil} blocks. -@end defspec +@end defmac @node Iteration @section Iteration @@ -1872,7 +1872,7 @@ The macros described here provide more sophisticated, high-level looping constructs to complement Emacs Lisp's basic @code{while} loop. -@defspec cl-loop forms@dots{} +@defmac cl-loop forms@dots{} The @code{CL} package supports both the simple, old-style meaning of @code{loop} and the extremely powerful and flexible feature known as the @dfn{Loop Facility} or @dfn{Loop Macro}. This more advanced @@ -1900,9 +1900,9 @@ interpreted as a Loop Macro specification as described later. (This is not a restriction in practice, since a plain symbol in the above notation would simply access and throw away the value of a variable.) -@end defspec +@end defmac -@defspec cl-do (spec@dots{}) (end-test [result@dots{}]) forms@dots{} +@defmac cl-do (spec@dots{}) (end-test [result@dots{}]) forms@dots{} This macro creates a general iterative loop. Each @var{spec} is of the form @@ -1948,9 +1948,9 @@ the rest of the loop. ((or (null x) (null y)) (nreverse z))) @end example -@end defspec +@end defmac -@defspec cl-do* (spec@dots{}) (end-test [result@dots{}]) forms@dots{} +@defmac cl-do* (spec@dots{}) (end-test [result@dots{}]) forms@dots{} This is to @code{cl-do} what @code{let*} is to @code{let}. In particular, the initial values are bound as if by @code{let*} rather than @code{let}, and the steps are assigned as if by @@ -1968,9 +1968,9 @@ Here is another way to write the above loop: (nreverse z)) (push (f x y) z)) @end example -@end defspec +@end defmac -@defspec cl-dolist (var list [result]) forms@dots{} +@defmac cl-dolist (var list [result]) forms@dots{} This is a more specialized loop which iterates across the elements of a list. @var{list} should evaluate to a list; the body @var{forms} are executed with @var{var} bound to each element of the list in @@ -1978,9 +1978,9 @@ turn. Finally, the @var{result} form (or @code{nil}) is evaluated with @var{var} bound to @code{nil} to produce the result returned by the loop. Unlike with Emacs's built in @code{dolist}, the loop is surrounded by an implicit @code{nil} block. -@end defspec +@end defmac -@defspec cl-dotimes (var count [result]) forms@dots{} +@defmac cl-dotimes (var count [result]) forms@dots{} This is a more specialized loop which iterates a specified number of times. The body is executed with @var{var} bound to the integers from zero (inclusive) to @var{count} (exclusive), in turn. Then @@ -1988,9 +1988,9 @@ the @code{result} form is evaluated with @var{var} bound to the total number of iterations that were done (i.e., @code{(max 0 @var{count})}) to get the return value for the loop form. Unlike with Emacs's built in @code{dolist}, the loop is surrounded by an implicit @code{nil} block. -@end defspec +@end defmac -@defspec cl-do-symbols (var [obarray [result]]) forms@dots{} +@defmac cl-do-symbols (var [obarray [result]]) forms@dots{} This loop iterates over all interned symbols. If @var{obarray} is specified and is not @code{nil}, it loops over all symbols in that obarray. For each symbol, the body @var{forms} are evaluated @@ -1998,12 +1998,12 @@ with @var{var} bound to that symbol. The symbols are visited in an unspecified order. Afterward the @var{result} form, if any, is evaluated (with @var{var} bound to @code{nil}) to get the return value. The loop is surrounded by an implicit @code{nil} block. -@end defspec +@end defmac -@defspec cl-do-all-symbols (var [result]) forms@dots{} +@defmac cl-do-all-symbols (var [result]) forms@dots{} This is identical to @code{cl-do-symbols} except that the @var{obarray} argument is omitted; it always iterates over the default obarray. -@end defspec +@end defmac @xref{Mapping over Sequences}, for some more functions for iterating over vectors or lists. @@ -2043,7 +2043,7 @@ Since @code{cl-loop} is a macro, all parsing of the loop language takes place at byte-compile time; compiled @code{cl-loop}s are just as efficient as the equivalent @code{while} loops written longhand. -@defspec cl-loop clauses@dots{} +@defmac cl-loop clauses@dots{} A loop construct consists of a series of @var{clause}s, each introduced by a symbol like @code{for} or @code{do}. Clauses are simply strung together in the argument list of @code{cl-loop}, @@ -2082,7 +2082,7 @@ explicit @code{return} clause to jump out of the implicit block. (Because the loop body is enclosed in an implicit block, you can also use regular Lisp @code{cl-return} or @code{cl-return-from} to break out of the loop.) -@end defspec +@end defmac The following sections give some examples of the Loop Macro in action, and describe the particular loop clauses in great detail. @@ -2773,21 +2773,21 @@ in Emacs Lisp these functions simply operate on lists instead. The @code{values} form, for example, is a synonym for @code{list} in Emacs. -@defspec cl-multiple-value-bind (var@dots{}) values-form forms@dots{} +@defmac cl-multiple-value-bind (var@dots{}) values-form forms@dots{} This form evaluates @var{values-form}, which must return a list of values. It then binds the @var{var}s to these respective values, as if by @code{let}, and then executes the body @var{forms}. If there are more @var{var}s than values, the extra @var{var}s are bound to @code{nil}. If there are fewer @var{var}s than values, the excess values are ignored. -@end defspec +@end defmac -@defspec cl-multiple-value-setq (var@dots{}) form +@defmac cl-multiple-value-setq (var@dots{}) form This form evaluates @var{form}, which must return a list of values. It then sets the @var{var}s to these respective values, as if by @code{setq}. Extra @var{var}s or values are treated the same as in @code{cl-multiple-value-bind}. -@end defspec +@end defmac Since a perfect emulation is not feasible in Emacs Lisp, this package opts to keep it as simple and predictable as possible. @@ -2805,7 +2805,7 @@ for @code{defmacro} due to technical difficulties. Destructuring is made available to the user by way of the following macro: -@defspec cl-destructuring-bind arglist expr forms@dots{} +@defmac cl-destructuring-bind arglist expr forms@dots{} This macro expands to code which executes @var{forms}, with the variables in @var{arglist} bound to the list of values returned by @var{expr}. The @var{arglist} can include all @@ -2814,13 +2814,13 @@ including destructuring. (The @code{&environment} keyword is not allowed.) The macro expansion will signal an error if @var{expr} returns a list of the wrong number of arguments or with incorrect keyword arguments. -@end defspec +@end defmac This package also includes the Common Lisp @code{cl-define-compiler-macro} facility, which allows you to define compile-time expansions and optimizations for your functions. -@defspec cl-define-compiler-macro name arglist forms@dots{} +@defmac cl-define-compiler-macro name arglist forms@dots{} This form is similar to @code{defmacro}, except that it only expands calls to @var{name} at compile-time; calls processed by the Lisp interpreter are not expanded, nor are they expanded by the @@ -2854,7 +2854,7 @@ if there are any keyword arguments in the call, then the original @code{cl-member} call is left intact. (The actual compiler macro for @code{cl-member} optimizes a number of other cases, including common @code{:test} predicates.) -@end defspec +@end defmac @defun cl-compiler-macroexpand form This function is analogous to @code{macroexpand}, except that it @@ -2896,7 +2896,7 @@ This function records a ``global'' declaration specified by is evaluated and thus should normally be quoted. @end defun -@defspec cl-declaim decl-specs@dots{} +@defmac cl-declaim decl-specs@dots{} This macro is like @code{cl-proclaim}, except that it takes any number of @var{decl-spec} arguments, and the arguments are unevaluated and unquoted. The @code{cl-declaim} macro also puts an @code{(cl-eval-when @@ -2905,22 +2905,22 @@ be registered at compile-time as well as at run-time. (This is vital, since normally the declarations are meant to influence the way the compiler treats the rest of the file that contains the @code{cl-declaim} form.) -@end defspec +@end defmac -@defspec cl-declare decl-specs@dots{} +@defmac cl-declare decl-specs@dots{} This macro is used to make declarations within functions and other code. Common Lisp allows declarations in various locations, generally at the beginning of any of the many ``implicit @code{progn}s'' throughout Lisp syntax, such as function bodies, @code{let} bodies, etc. Currently the only declaration understood by @code{cl-declare} is @code{special}. -@end defspec +@end defmac -@defspec cl-locally declarations@dots{} forms@dots{} +@defmac cl-locally declarations@dots{} forms@dots{} In this package, @code{cl-locally} is no different from @code{progn}. -@end defspec +@end defmac -@defspec cl-the type form +@defmac cl-the type form Type information provided by @code{cl-the} is ignored in this package; in other words, @code{(cl-the @var{type} @var{form})} is equivalent to @var{form}. Future versions of the optimizing byte-compiler may @@ -2933,7 +2933,7 @@ of time. With @code{(mapcar 'car (cl-the vector foo))}, a future compiler would have enough information to expand the loop in-line. For now, Emacs Lisp will treat the above code as exactly equivalent to @code{(mapcar 'car foo)}. -@end defspec +@end defmac Each @var{decl-spec} in a @code{cl-proclaim}, @code{cl-declaim}, or @code{cl-declare} should be a list beginning with a symbol that says @@ -3137,7 +3137,7 @@ function and its @var{place} argument can actually be any Lisp expression. @end defun -@defspec cl-remf place property +@defmac cl-remf place property This macro removes the property-value pair for @var{property} from the property list stored at @var{place}, which is any @code{setf}-able place expression. It returns true if the property was found. Note @@ -3145,7 +3145,7 @@ that if @var{property} happens to be first on the list, this will effectively do a @code{(setf @var{place} (cddr @var{place}))}, whereas if it occurs later, this simply uses @code{setcdr} to splice out the property and value cells. -@end defspec +@end defmac @node Creating Symbols @section Creating Symbols @@ -4259,7 +4259,7 @@ system provides no way to create new distinct types, this package implements structures as vectors (or lists upon request) with a special ``tag'' symbol to identify them. -@defspec cl-defstruct name slots@dots{} +@defmac cl-defstruct name slots@dots{} The @code{cl-defstruct} form defines a new structure type called @var{name}, with the specified @var{slots}. (The @var{slots} may begin with a string which documents the structure type.) @@ -4563,7 +4563,7 @@ the type @code{:include}s another type, then @code{:initial-offset} specifies a number of slots to be skipped between the last slot of the included type and the first new slot. @end table -@end defspec +@end defmac Except as noted, the @code{cl-defstruct} facility of this package is entirely compatible with that of Common Lisp. @@ -4582,7 +4582,7 @@ If the optimization property @code{speed} has been set to 3, and away the following assertions. Because assertions might be optimized away, it is a bad idea for them to include side-effects. -@defspec cl-assert test-form [show-args string args@dots{}] +@defmac cl-assert test-form [show-args string args@dots{}] This form verifies that @var{test-form} is true (i.e., evaluates to a non-@code{nil} value). If so, it returns @code{nil}. If the test is not satisfied, @code{cl-assert} signals an error. @@ -4606,9 +4606,9 @@ true Common Lisp, the second argument gives a list of @var{places} which can be @code{setf}'d by the user before continuing from the error. Since Emacs Lisp does not support continuable errors, it makes no sense to specify @var{places}. -@end defspec +@end defmac -@defspec cl-check-type form type [string] +@defmac cl-check-type form type [string] This form verifies that @var{form} evaluates to a value of type @var{type}. If so, it returns @code{nil}. If not, @code{cl-check-type} signals a @code{wrong-type-argument} error. The default error message @@ -4627,7 +4627,7 @@ Note that in Common Lisp, the first argument to @code{check-type} must be a @var{place} suitable for use by @code{setf}, because @code{check-type} signals a continuable error that allows the user to modify @var{place}. -@end defspec +@end defmac @node Efficiency Concerns @appendix Efficiency Concerns @@ -4660,12 +4660,10 @@ readable @code{cl-incf} form in your compiled code. @emph{Interpreted} code, on the other hand, must expand these macros every time they are executed. For this reason it is strongly recommended that code making heavy use of macros be compiled. -@c FIXME why are they not labelled as macros? -(The features labeled ``Special Form'' instead of ``Function'' in -this manual are macros.) A loop using @code{cl-incf} a hundred times -will execute considerably faster if compiled, and will also -garbage-collect less because the macro expansion will not have -to be generated, used, and thrown away a hundred times. +A loop using @code{cl-incf} a hundred times will execute considerably +faster if compiled, and will also garbage-collect less because the +macro expansion will not have to be generated, used, and thrown away a +hundred times. You can find out how a macro expands by using the @code{cl-prettyexpand} function. From 82b2101791236f7f0b5ee8a39fb05ab0d5e7834f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 27 Oct 2012 17:16:55 -0700 Subject: [PATCH 065/109] * doc/emacs/ack.texi (Acknowledgments): Mention gv.el. --- doc/emacs/ChangeLog | 4 ++++ doc/emacs/ack.texi | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 3c21a60394a..ef6d736db1d 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2012-10-28 Glenn Morris + + * ack.texi (Acknowledgments): Mention gv.el. + 2012-10-27 Bastien Guerry * screen.texi (Menu Bar): Fix typo. 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; client for the ``Music Player Daemon''; @file{smie.el}, a generic indentation engine; and @file{pcase.el}, implementing ML-style pattern matching. In Emacs 24, he integrated the lexical binding code, -and cleaned up the CL namespace (making it acceptable to use CL -functions at runtime). +cleaned up the CL namespace (making it acceptable to use CL +functions at runtime), and added generalized variables to core Emacs +Lisp. @item Morioka Tomohiko wrote several packages for MIME support in Gnus and From 3c0c6155a1ba0179e4099348727ba3243df73be6 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 27 Oct 2012 18:55:40 -0700 Subject: [PATCH 066/109] Start moving some cl.texi features to an Obsolete appendix * doc/misc/cl.texi (Lexical Bindings): Move to appendix of obsolete features. (Porting Common Lisp): Emacs Lisp can do true lexical binding now. (Obsolete Features): New appendix. Move Lexical Bindings here. --- doc/misc/ChangeLog | 6 + doc/misc/cl.texi | 297 +++++++++++++++++++++++---------------------- 2 files changed, 159 insertions(+), 144 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 24d8f1cee25..c5d084891f6 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,9 @@ +2012-10-28 Glenn Morris + + * cl.texi (Lexical Bindings): Move to appendix of obsolete features. + (Porting Common Lisp): Emacs Lisp can do true lexical binding now. + (Obsolete Features): New appendix. Move Lexical Bindings here. + 2012-10-27 Glenn Morris * cl.texi: Use defmac for macros rather than defspec. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 09386e2c0c7..46e9dae5319 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -70,6 +70,7 @@ developing GNU and promoting software freedom.'' * Efficiency Concerns:: Hints and techniques. * Common Lisp Compatibility:: All known differences with Steele. * Porting Common Lisp:: Hints for porting Common Lisp code. +* Obsolete Features:: Obsolete features. * GNU Free Documentation License:: The license for this documentation. * Function Index:: @@ -210,7 +211,6 @@ Internal function and variable names in the package are prefixed by @code{cl--}. Here is a complete list of functions prefixed by @code{cl-} that were not taken from Common Lisp: -@c FIXME lexical-let lexical-let* @example cl-callf cl-callf2 cl-defsubst cl-floatp-safe cl-letf cl-letf* @@ -806,12 +806,11 @@ standard @code{setf} facility, and a number of looping and conditional constructs. @c FIXME -@c lexical-let is obsolete; flet is not cl-flet. -@c values is not cl-values. +@c flet is not cl-flet, values is not cl-values. @menu * Assignment:: The @code{cl-psetq} form. * Generalized Variables:: Extensions to generalized variables. -* Variable Bindings:: @code{cl-progv}, @code{lexical-let}, @code{flet}, @code{cl-macrolet}. +* Variable Bindings:: @code{cl-progv}, @code{flet}, @code{cl-macrolet}. * Conditionals:: @code{cl-case}, @code{cl-typecase}. * Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}. * Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}. @@ -1422,7 +1421,6 @@ are also related to variable bindings. @menu * Dynamic Bindings:: The @code{cl-progv} form. -* Lexical Bindings:: @code{lexical-let} and lexical closures. * Function Bindings:: @code{flet} and @code{labels}. * Macro Bindings:: @code{cl-macrolet} and @code{cl-symbol-macrolet}. @end menu @@ -1447,120 +1445,6 @@ If @var{symbols} is shorter than @var{values}, the excess values are ignored. @end defmac -@node Lexical Bindings -@subsection Lexical Bindings - -@noindent -The @code{CL} package defines the following macro which -more closely follows the Common Lisp @code{let} form: - -@defmac lexical-let (bindings@dots{}) forms@dots{} -This form is exactly like @code{let} except that the bindings it -establishes are purely lexical. Lexical bindings are similar to -local variables in a language like C: Only the code physically -within the body of the @code{lexical-let} (after macro expansion) -may refer to the bound variables. - -@example -(setq a 5) -(defun foo (b) (+ a b)) -(let ((a 2)) (foo a)) - @result{} 4 -(lexical-let ((a 2)) (foo a)) - @result{} 7 -@end example - -@noindent -In this example, a regular @code{let} binding of @code{a} actually -makes a temporary change to the global variable @code{a}, so @code{foo} -is able to see the binding of @code{a} to 2. But @code{lexical-let} -actually creates a distinct local variable @code{a} for use within its -body, without any effect on the global variable of the same name. - -The most important use of lexical bindings is to create @dfn{closures}. -A closure is a function object that refers to an outside lexical -variable. For example: - -@example -(defun make-adder (n) - (lexical-let ((n n)) - (function (lambda (m) (+ n m))))) -(setq add17 (make-adder 17)) -(funcall add17 4) - @result{} 21 -@end example - -@noindent -The call @code{(make-adder 17)} returns a function object which adds -17 to its argument. If @code{let} had been used instead of -@code{lexical-let}, the function object would have referred to the -global @code{n}, which would have been bound to 17 only during the -call to @code{make-adder} itself. - -@example -(defun make-counter () - (lexical-let ((n 0)) - (cl-function (lambda (&optional (m 1)) (cl-incf n m))))) -(setq count-1 (make-counter)) -(funcall count-1 3) - @result{} 3 -(funcall count-1 14) - @result{} 17 -(setq count-2 (make-counter)) -(funcall count-2 5) - @result{} 5 -(funcall count-1 2) - @result{} 19 -(funcall count-2) - @result{} 6 -@end example - -@noindent -Here we see that each call to @code{make-counter} creates a distinct -local variable @code{n}, which serves as a private counter for the -function object that is returned. - -Closed-over lexical variables persist until the last reference to -them goes away, just like all other Lisp objects. For example, -@code{count-2} refers to a function object which refers to an -instance of the variable @code{n}; this is the only reference -to that variable, so after @code{(setq count-2 nil)} the garbage -collector would be able to delete this instance of @code{n}. -Of course, if a @code{lexical-let} does not actually create any -closures, then the lexical variables are free as soon as the -@code{lexical-let} returns. - -Many closures are used only during the extent of the bindings they -refer to; these are known as ``downward funargs'' in Lisp parlance. -When a closure is used in this way, regular Emacs Lisp dynamic -bindings suffice and will be more efficient than @code{lexical-let} -closures: - -@example -(defun add-to-list (x list) - (mapcar (lambda (y) (+ x y))) list) -(add-to-list 7 '(1 2 5)) - @result{} (8 9 12) -@end example - -@noindent -Since this lambda is only used while @code{x} is still bound, -it is not necessary to make a true closure out of it. - -You can use @code{defun} or @code{flet} inside a @code{lexical-let} -to create a named closure. If several closures are created in the -body of a single @code{lexical-let}, they all close over the same -instance of the lexical variable. - -The @code{lexical-let} form is an extension to Common Lisp. In -true Common Lisp, all bindings are lexical unless declared otherwise. -@end defmac - -@defmac lexical-let* (bindings@dots{}) forms@dots{} -This form is just like @code{lexical-let}, except that the bindings -are made sequentially in the manner of @code{let*}. -@end defmac - @node Function Bindings @subsection Function Bindings @@ -1650,6 +1534,10 @@ arguments to @code{cl-defmacro} (i.e., a macro name, argument list, and macro-expander forms). The macro is defined accordingly for use within the body of the @code{cl-macrolet}. +@c FIXME this should be modified to say ``even when lexical-binding +@c is code{nil}'', but is that true? The doc of cl-macrolet just +@c refers us to cl-flet, which refers to cl-labels, which says that it +@c behaves differently according to whether l-b is true or not. Because of the nature of macros, @code{cl-macrolet} is lexically scoped even in Emacs Lisp: The @code{cl-macrolet} binding will affect only calls that appear physically within the body @@ -1678,8 +1566,10 @@ I.e., @code{(setq foo 4)} in the above would be equivalent to Likewise, a @code{let} or @code{let*} binding a symbol macro is treated like a @code{letf} or @code{cl-letf*}. This differs from true +@c FIXME does it work like this in Emacs with lexical-binding = t? Common Lisp, where the rules of lexical scoping cause a @code{let} binding to shadow a @code{cl-symbol-macrolet} binding. In this package, +@c FIXME obsolete. only @code{lexical-let} and @code{lexical-let*} will shadow a symbol macro. @@ -4861,19 +4751,15 @@ this convention, calls to Lisp builtins like @code{if} and @item Lexical scoping. In Common Lisp, function arguments and @code{let} -bindings apply only to references physically within their bodies -(or within macro expansions in their bodies). Emacs Lisp, by -contrast, uses @dfn{dynamic scoping} wherein a binding to a -variable is visible even inside functions called from the body. +bindings apply only to references physically within their bodies (or +within macro expansions in their bodies). Traditionally, Emacs Lisp +uses @dfn{dynamic scoping} wherein a binding to a variable is visible +even inside functions called from the body. Lexical binding is +available since Emacs 24.1, so be sure to set @code{lexical-binding} +to @code{t} if you need to emulate this aspect of Common Lisp. -Variables in Common Lisp can be made dynamically scoped by -declaring them @code{special} or using @code{defvar}. In Emacs -Lisp it is as if all variables were declared @code{special}. - -Often you can use code that was written for lexical scoping -even in a dynamically scoped Lisp, but not always. Here is -an example of a Common Lisp code fragment that would fail in -Emacs Lisp: +Here is an example of a Common Lisp code fragment that would fail in +Emacs Lisp if @code{lexical-binding} were set to @code{nil}: @example (defun map-odd-elements (func list) @@ -4886,20 +4772,16 @@ Emacs Lisp: @end example @noindent -In Common Lisp, the two functions' usages of @code{x} are completely -independent. In Emacs Lisp, the binding to @code{x} made by -@code{add-odd-elements} will have been hidden by the binding -in @code{map-odd-elements} by the time the @code{(+ a x)} function -is called. +With lexical binding, the two functions' usages of @code{x} are +completely independent. With dynamic binding, the binding to @code{x} +made by @code{add-odd-elements} will have been hidden by the binding +in @code{map-odd-elements} by the time the @code{(+ a x)} function is +called. -(This package avoids such problems in its own mapping functions -by using names like @code{cl--x} instead of @code{x} internally; -as long as you don't use this prefix for your own -variables no collision can occur.) - -@xref{Lexical Bindings}, for a description of the @code{lexical-let} -form which establishes a Common Lisp-style lexical binding, and some -examples of how it differs from Emacs's regular @code{let}. +Internally, this package uses lexical binding so that such problems do +not occur. @xref{Lexical Bindings}, for a description of the obsolete +@code{lexical-let} form that emulates a Common Lisp-style lexical +binding when dynamic binding is in use. @item Reader macros. Common Lisp includes a second type of macro that @@ -5039,6 +4921,133 @@ note that the current Emacs Lisp compiler does not optimize tail recursion. @end itemize +@node Obsolete Features +@appendix Obsolete Features + +This section describes some features of the package that are obsolete +and should not be used in new code. They are only provided by the old +@file{cl.el} entry point, not by the newer @file{cl-lib.el}. + +@menu +* Lexical Bindings:: An approximation of lexical binding. +@end menu + +@node Lexical Bindings +@appendixsec Lexical Bindings + +The following macros are extensions to Common Lisp, where all bindings +are lexical unless declared otherwise. These features are likewise +obsolete since the introduction of true lexical binding in Emacs 24.1. + +@defmac lexical-let (bindings@dots{}) forms@dots{} +This form is exactly like @code{let} except that the bindings it +establishes are purely lexical. +@end defmac + +@c FIXME remove this and refer to elisp manual. +@c Maybe merge some stuff from here to there? +@noindent +Lexical bindings are similar to local variables in a language like C: +Only the code physically within the body of the @code{lexical-let} +(after macro expansion) may refer to the bound variables. + +@example +(setq a 5) +(defun foo (b) (+ a b)) +(let ((a 2)) (foo a)) + @result{} 4 +(lexical-let ((a 2)) (foo a)) + @result{} 7 +@end example + +@noindent +In this example, a regular @code{let} binding of @code{a} actually +makes a temporary change to the global variable @code{a}, so @code{foo} +is able to see the binding of @code{a} to 2. But @code{lexical-let} +actually creates a distinct local variable @code{a} for use within its +body, without any effect on the global variable of the same name. + +The most important use of lexical bindings is to create @dfn{closures}. +A closure is a function object that refers to an outside lexical +variable. For example: + +@example +(defun make-adder (n) + (lexical-let ((n n)) + (function (lambda (m) (+ n m))))) +(setq add17 (make-adder 17)) +(funcall add17 4) + @result{} 21 +@end example + +@noindent +The call @code{(make-adder 17)} returns a function object which adds +17 to its argument. If @code{let} had been used instead of +@code{lexical-let}, the function object would have referred to the +global @code{n}, which would have been bound to 17 only during the +call to @code{make-adder} itself. + +@example +(defun make-counter () + (lexical-let ((n 0)) + (cl-function (lambda (&optional (m 1)) (cl-incf n m))))) +(setq count-1 (make-counter)) +(funcall count-1 3) + @result{} 3 +(funcall count-1 14) + @result{} 17 +(setq count-2 (make-counter)) +(funcall count-2 5) + @result{} 5 +(funcall count-1 2) + @result{} 19 +(funcall count-2) + @result{} 6 +@end example + +@noindent +Here we see that each call to @code{make-counter} creates a distinct +local variable @code{n}, which serves as a private counter for the +function object that is returned. + +Closed-over lexical variables persist until the last reference to +them goes away, just like all other Lisp objects. For example, +@code{count-2} refers to a function object which refers to an +instance of the variable @code{n}; this is the only reference +to that variable, so after @code{(setq count-2 nil)} the garbage +collector would be able to delete this instance of @code{n}. +Of course, if a @code{lexical-let} does not actually create any +closures, then the lexical variables are free as soon as the +@code{lexical-let} returns. + +Many closures are used only during the extent of the bindings they +refer to; these are known as ``downward funargs'' in Lisp parlance. +When a closure is used in this way, regular Emacs Lisp dynamic +bindings suffice and will be more efficient than @code{lexical-let} +closures: + +@example +(defun add-to-list (x list) + (mapcar (lambda (y) (+ x y))) list) +(add-to-list 7 '(1 2 5)) + @result{} (8 9 12) +@end example + +@noindent +Since this lambda is only used while @code{x} is still bound, +it is not necessary to make a true closure out of it. + +You can use @code{defun} or @code{flet} inside a @code{lexical-let} +to create a named closure. If several closures are created in the +body of a single @code{lexical-let}, they all close over the same +instance of the lexical variable. + +@defmac lexical-let* (bindings@dots{}) forms@dots{} +This form is just like @code{lexical-let}, except that the bindings +are made sequentially in the manner of @code{let*}. +@end defmac + + @node GNU Free Documentation License @appendix GNU Free Documentation License @include doclicense.texi From 9c52d61d070c1e8961ce376f4829e364960cda97 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 27 Oct 2012 19:05:04 -0700 Subject: [PATCH 067/109] Add some xrefs to cl.texi * doc/misc/cl.texi (Porting Common Lisp, Lexical Bindings): Add some xrefs to the Elisp manual. --- doc/misc/ChangeLog | 3 +++ doc/misc/cl.texi | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index c5d084891f6..6d744908ebe 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,5 +1,8 @@ 2012-10-28 Glenn Morris + * cl.texi (Porting Common Lisp, Lexical Bindings): + Add some xrefs to the Elisp manual. + * cl.texi (Lexical Bindings): Move to appendix of obsolete features. (Porting Common Lisp): Emacs Lisp can do true lexical binding now. (Obsolete Features): New appendix. Move Lexical Bindings here. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 46e9dae5319..aebdcb7d5f4 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -4754,9 +4754,11 @@ Lexical scoping. In Common Lisp, function arguments and @code{let} bindings apply only to references physically within their bodies (or within macro expansions in their bodies). Traditionally, Emacs Lisp uses @dfn{dynamic scoping} wherein a binding to a variable is visible -even inside functions called from the body. Lexical binding is -available since Emacs 24.1, so be sure to set @code{lexical-binding} -to @code{t} if you need to emulate this aspect of Common Lisp. +even inside functions called from the body. +@xref{Dynamic Binding,,,elisp,GNU Emacs Lisp Reference Manual}. +Lexical binding is available since Emacs 24.1, so be sure to set +@code{lexical-binding} to @code{t} if you need to emulate this aspect +of Common Lisp. @xref{Lexical Binding,,,elisp,GNU Emacs Lisp Reference Manual}. Here is an example of a Common Lisp code fragment that would fail in Emacs Lisp if @code{lexical-binding} were set to @code{nil}: @@ -4969,7 +4971,8 @@ body, without any effect on the global variable of the same name. The most important use of lexical bindings is to create @dfn{closures}. A closure is a function object that refers to an outside lexical -variable. For example: +variable (@pxref{Closures,,,elisp,GNU Emacs Lisp Reference Manual}). +For example: @example (defun make-adder (n) From f94b04fcc7490510d85ce107b65c48bc60334f63 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 27 Oct 2012 19:34:36 -0700 Subject: [PATCH 068/109] More cl.texi updates * doc/misc/cl.texi (Multiple Values, Common Lisp Compatibility): More namespace updates. (Obsolete Features): Copyedits. (Obsolete Lexical Macros, Obsolete Setf Customization): New subsections. * etc/NEWS: Related edits. --- doc/misc/ChangeLog | 6 +++++ doc/misc/cl.texi | 60 +++++++++++++++++++++++++++++++++++++++------- etc/NEWS | 6 +++++ 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 6d744908ebe..fe7781c57cc 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,5 +1,11 @@ 2012-10-28 Glenn Morris + * cl.texi (Multiple Values, Common Lisp Compatibility): + More namespace updates. + (Obsolete Features): Copyedits. + (Obsolete Lexical Macros, Obsolete Setf Customization): + New subsections. + * cl.texi (Porting Common Lisp, Lexical Bindings): Add some xrefs to the Elisp manual. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index aebdcb7d5f4..ed4206c0b97 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -806,7 +806,7 @@ standard @code{setf} facility, and a number of looping and conditional constructs. @c FIXME -@c flet is not cl-flet, values is not cl-values. +@c flet is not cl-flet. @menu * Assignment:: The @code{cl-psetq} form. * Generalized Variables:: Extensions to generalized variables. @@ -815,7 +815,7 @@ constructs. * Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}. * Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}. * Loop Facility:: The Common Lisp @code{cl-loop} macro. -* Multiple Values:: @code{values}, @code{cl-multiple-value-bind}, etc. +* Multiple Values:: @code{cl-values}, @code{cl-multiple-value-bind}, etc. @end menu @node Assignment @@ -2660,7 +2660,7 @@ than one value either return just the first value (as in @code{get-setf-method}). This package @emph{does} define placeholders for the Common Lisp functions that work with multiple values, but in Emacs Lisp these functions simply operate on lists instead. -The @code{values} form, for example, is a synonym for @code{list} +The @code{cl-values} form, for example, is a synonym for @code{list} in Emacs. @defmac cl-multiple-value-bind (var@dots{}) values-form forms@dots{} @@ -4701,9 +4701,9 @@ and type specifiers are unimplemented. The multiple-value return facility treats lists as multiple values, since Emacs Lisp cannot support multiple return values directly. The macros will be compatible with Common Lisp if -@code{values} or @code{values-list} is always used to return to +@code{cl-values} or @code{cl-values-list} is always used to return to a @code{cl-multiple-value-bind} or other multiple-value receiver; -if @code{values} is used without @code{cl-multiple-value-@dots{}} +if @code{cl-values} is used without @code{cl-multiple-value-@dots{}} or vice-versa the effect will be different from Common Lisp. Many Common Lisp declarations are ignored, and others match @@ -4927,11 +4927,15 @@ recursion. @appendix Obsolete Features This section describes some features of the package that are obsolete -and should not be used in new code. They are only provided by the old -@file{cl.el} entry point, not by the newer @file{cl-lib.el}. +and should not be used in new code. They are either only provided by +the old @file{cl.el} entry point, not by the newer @file{cl-lib.el}; +or where versions with a @samp{cl-} prefix do exist they do not behave +in exactly the same way. @menu -* Lexical Bindings:: An approximation of lexical binding. +* Lexical Bindings:: An approximation of lexical binding. +* Obsolete Lexical Macros:: Obsolete macros using lexical-let. +* Obsolete Setf Customization:: Obsolete ways to customize setf. @end menu @node Lexical Bindings @@ -5050,6 +5054,46 @@ This form is just like @code{lexical-let}, except that the bindings are made sequentially in the manner of @code{let*}. @end defmac +@node Obsolete Lexical Macros +@appendixsec Macros Defined Using Lexical-Let + +The following macros are defined using @code{lexical-let}. +They are replaced by versions with a @samp{cl-} prefix that use true +lexical binding (and hence rely on @code{lexical-binding} being set to +@code{t} in code using them). + +@defmac flet (bindings@dots{}) forms@dots{} +Replaced by @code{cl-flet} (@pxref{Function Bindings}) +or @code{cl-letf} (@pxref{Modify Macros}). +@end defmac + +@defmac labels (bindings@dots{}) forms@dots{} +Replaced by @code{cl-labels} (@pxref{Function Bindings}). +@end defmac + +@defmac letf (bindings@dots{}) forms@dots{} +Replaced by @code{cl-letf} (@pxref{Modify Macros}). +@end defmac + +@node Obsolete Setf Customization +@appendixsec Obsolete Ways to Customize Setf + +This section describes some obsolete ways to extend @code{setf}. +They are replaced by @file{gv.el} in Emacs 24.3. + +@c FIXME. +@defmac define-setf-expander name arglist &rest body +Use @file{gv.el}. +@end defmac + +@defmac defsetf access-fn update-fn +Use @file{gv.el}. +@end defmac + +@defmac define-modify-macro name arglist function [doc-string] +Use @file{gv.el}. +@end defmac + @node GNU Free Documentation License @appendix GNU Free Documentation License diff --git a/etc/NEWS b/etc/NEWS index 45ca56f5da6..cfdd3355aa5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -323,11 +323,17 @@ The difference is that it relies on the `lexical-binding' machinery (as opposed to the `lexical-let' machinery used previously) to capture definitions in closures, so such closures will only work if `lexical-binding' is in use. +*** `cl-letf' is not exactly like `letf'. + +++ *** `progv' was rewritten to use the `let' machinery. A side effect is that vars without corresponding value are bound to nil rather than making them unbound. +*** The following methods of extending `setf' are obsolete. +Use gv.el instead (FIXME; details). +`define-setf-expander', `defsetf', `define-modify-macro' + ** Compilation mode +++ *** New option `compilation-always-kill'. From 3a51f0eb4168885b869641e9d5c98e3f40e5a515 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sun, 28 Oct 2012 13:56:15 +0100 Subject: [PATCH 069/109] Reformulate description of windows basics. Describe changes in window ordering. * windows.texi (Basic Windows): Reformulate description of live, internal and valid windows. (Cyclic Window Ordering): Describe new argument of get-lru-window and get-largest-window. Add description of window-in-direction. --- doc/lispref/ChangeLog | 8 ++++ doc/lispref/windows.texi | 83 +++++++++++++++++++++++++++------------- 2 files changed, 65 insertions(+), 26 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index aea26248452..fe12e27a070 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,11 @@ +2012-10-28 Martin Rudalics + + * windows.texi (Basic Windows): Reformulate description of live, + internal and valid windows. + (Cyclic Window Ordering): Describe new argument of + get-lru-window and get-largest-window. Add description of + window-in-direction. + 2012-10-27 Glenn Morris * variables.texi (Generalized Variables): New section, diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 31d33bffbdd..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 deleted, the change in window space is taken from or given to the adjacent windows, so that the total area of the frame is unchanged. -@cindex live windows -@cindex internal windows - A @dfn{live window} is one that is actually displaying a buffer in a -frame. Such a window can be @dfn{deleted}, i.e. removed from the -frame (@pxref{Deleting Windows}); then it is no longer live, but the -Lisp object representing it might be still referenced from other Lisp -objects. A deleted window may be brought back to life by restoring a -saved window configuration (@pxref{Window Configurations}). - @defun windowp object This function returns @code{t} if @var{object} is a window (whether or -not it is live). Otherwise, it returns @code{nil}. +not it displays a buffer). Otherwise, it returns @code{nil}. @end defun +@cindex live windows +A @dfn{live window} is one that is actually displaying a buffer in a +frame. + @defun window-live-p object This function returns @code{t} if @var{object} is a live window and @code{nil} otherwise. A live window is one that displays a buffer. @end defun - The windows in each frame are organized into a @dfn{window tree}. -@xref{Windows and Frames}. The leaf nodes of each window tree are -live windows---the ones actually displaying buffers. The internal -nodes of the window tree are internal windows, which are not live. -You can distinguish internal windows from deleted windows with +@cindex internal windows +The windows in each frame are organized into a @dfn{window tree}. +@xref{Windows and Frames}. The leaf nodes of each window tree are live +windows---the ones actually displaying buffers. The internal nodes of +the window tree are @dfn{internal windows}, which are not live. + +@cindex valid windows + A @dfn{valid window} is one that is either live or internal. A valid +window can be @dfn{deleted}, i.e. removed from its frame +(@pxref{Deleting Windows}); then it is no longer valid, but the Lisp +object representing it might be still referenced from other Lisp +objects. A deleted window may be made valid again by restoring a saved +window configuration (@pxref{Window Configurations}). + + You can distinguish valid windows from deleted windows with @code{window-valid-p}. @defun window-valid-p object @@ -1317,31 +1322,37 @@ meaning as for @code{next-window}. criterion, without selecting it: @cindex least recently used window -@defun get-lru-window &optional all-frames dedicated +@defun get-lru-window &optional all-frames dedicated not-selected This function returns a live window which is heuristically the ``least recently used'' window. The optional argument @var{all-frames} has the same meaning as in @code{next-window}. If any full-width windows are present, only those windows are -considered. The selected window is never returned, unless it is the -only candidate. A minibuffer window is never a candidate. A -dedicated window (@pxref{Dedicated Windows}) is never a candidate -unless the optional argument @var{dedicated} is non-@code{nil}. +considered. A minibuffer window is never a candidate. A dedicated +window (@pxref{Dedicated Windows}) is never a candidate unless the +optional argument @var{dedicated} is non-@code{nil}. The selected +window is never returned, unless it is the only candidate. However, if +the optional argument @var{not-selected} is non-@code{nil}, this +function returns @code{nil} in that case. @end defun @cindex largest window -@defun get-largest-window &optional all-frames dedicated +@defun get-largest-window &optional all-frames dedicated not-selected This function returns the window with the largest area (height times -width). A minibuffer window is never a candidate. A dedicated window +width). The optional argument @var{all-frames} specifies the windows to +search, and has the same meaning as in @code{next-window}. + +A minibuffer window is never a candidate. A dedicated window (@pxref{Dedicated Windows}) is never a candidate unless the optional -argument @var{dedicated} is non-@code{nil}. +argument @var{dedicated} is non-@code{nil}. The selected window is not +a candidate if the optional argument @var{not-selected} is +non-@code{nil}. If the optional argument @var{not-selected} is +non-@code{nil} and the selected window is the only candidate, this +function returns @code{nil}. If there are two candidate windows of the same size, this function prefers the one that comes first in the cyclic ordering of windows, starting from the selected window. - -The optional argument @var{all-frames} specifies the windows to -search, and has the same meaning as in @code{next-window}. @end defun @cindex window that satisfies a predicate @@ -1359,6 +1370,26 @@ windows to search, and have the same meanings as in @code{next-window}. @end defun +@cindex window in direction +@defun window-in-direction direction &optional window ignore +This function returns the nearest window in direction @var{direction} as +seen from the position of @code{window-point} in window @var{window}. +The argument @var{direction} must be one of @code{above}, @code{below}, +@code{left} or @code{right}. The optional argument @var{window} must +denote a live window and defaults to the selected one. + +This function does not return a window whose @code{no-other-window} +parameter is non-@code{nil}. If the nearest window's +@code{no-other-window} parameter is non-@code{nil}, this function tries +to find another window in the indicated direction whose +@code{no-other-window} parameter is @code{nil}. If the optional +argument @var{ignore} is non-@code{nil}, a window may be returned even +if its @code{no-other-window} parameter is non-@code{nil}. + +If it doesn't find a suitable window, this function returns @code{nil}. +@end defun + + @node Buffers and Windows @section Buffers and Windows @cindex examining windows From 70edffb13005de4aa58ba818559b85aa63a1cdd4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 28 Oct 2012 10:56:51 -0400 Subject: [PATCH 070/109] * lisp/tmm.el (tmm-prompt): Use map-keymap. * doc/lispref/keymaps.texi (Format of Keymaps): Document the multiple inheritance format. Fixes: debbugs:12744 --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/keymaps.texi | 5 +++++ lisp/ChangeLog | 4 ++++ lisp/tmm.el | 27 +++++++++++++++------------ 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index fe12e27a070..6b3febba631 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-10-28 Stefan Monnier + + * keymaps.texi (Format of Keymaps): Document the multiple + inheritance format. + 2012-10-28 Martin Rudalics * windows.texi (Basic Windows): Reformulate description of live, diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 8fe729d50f2..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 have a string as an element. This is called the @dfn{overall prompt string} and makes it possible to use the keymap as a menu. @xref{Defining Menus}. + +@item (keymap @dots{}) +If an element of a keymap is itself a keymap, it counts as if this inner keymap +were inlined in the outer keymap. This is used for multiple-inheritance, such +as in @code{make-composed-keymap}. @end table When the binding is @code{nil}, it doesn't constitute a definition diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d7349617d58..c52ed5e6e8b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-28 Stefan Monnier + + * tmm.el (tmm-prompt): Use map-keymap (bug#12744). + 2012-10-27 Eli Zaretskii * profiler.el (profiler-report-make-entry-part): Fix help-echo 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." ;; tmm-km-list is an alist of (STRING . MEANING). ;; It has no other elements. ;; The order of elements in tmm-km-list is the order of the menu bar. - (dolist (elt menu) - (cond - ((stringp elt) (setq gl-str elt)) - ((listp elt) (tmm-get-keymap elt not-menu)) - ((vectorp elt) - (dotimes (i (length elt)) - (tmm-get-keymap (cons i (aref elt i)) not-menu))))) + (if (not not-menu) + (map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu) + (dolist (elt menu) + (cond + ((stringp elt) (setq gl-str elt)) + ((listp elt) (tmm-get-keymap elt not-menu)) + ((vectorp elt) + (dotimes (i (length elt)) + (tmm-get-keymap (cons i (aref elt i)) not-menu)))))) ;; Choose an element of tmm-km-list; put it in choice. (if (and not-menu (= 1 (length tmm-km-list))) ;; 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." (or (keymapp (cdr-safe (cdr-safe elt))) (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) (and (symbolp (cdr-safe (cdr-safe elt))) - (fboundp (cdr-safe (cdr-safe elt))))) + (fboundp (cdr-safe (cdr-safe elt))))) (setq km (cddr elt)) (and (stringp (car elt)) (setq str (car elt)))) @@ -458,14 +460,15 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt)))) (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) - ; New style of easy-menu + ; New style of easy-menu (setq km (cdr (cddr elt))) (and (stringp (car elt)) (setq str (car elt)))) ((stringp event) ; x-popup or x-popup element - (if (or in-x-menu (stringp (car-safe elt))) - (setq str event event nil km elt) - (setq str event event nil km (cons 'keymap elt))))) + (setq str event) + (setq event nil) + (setq km (if (or in-x-menu (stringp (car-safe elt))) + elt (cons 'keymap elt))))) (unless (or (eq km 'ignore) (null str)) (let ((binding (where-is-internal km nil t))) (when binding From 3bb08684ceb7aace5a57d3260332fbb092a2fbe6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 28 Oct 2012 11:32:15 -0400 Subject: [PATCH 071/109] * lisp/erc/erc-backend.el: Only require `erc' during compilation. Fixes: debbugs:12486 --- lisp/erc/ChangeLog | 4 ++++ lisp/erc/erc-backend.el | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index bb8dadbbfcd..ba9dd70e88a 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2012-10-28 Stefan Monnier + + * erc-backend.el: Only require `erc' during compilation (bug#12486). + 2012-10-18 Stefan Monnier * 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 @@ ;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. ;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the ;; reverse is true: -(provide 'erc-backend) -(require 'erc) +(eval-when-compile (provide 'erc-backend) (require 'erc)) ;;;; Variables and options From 15a8af19f431e183d9842edb6f60b117cda77319 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 28 Oct 2012 11:34:52 -0400 Subject: [PATCH 072/109] * lisp/erc/erc-backend.el: Fix last bug number. Fixes: debbugs:12740 --- lisp/erc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index ba9dd70e88a..13dbba769a4 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,6 +1,6 @@ 2012-10-28 Stefan Monnier - * erc-backend.el: Only require `erc' during compilation (bug#12486). + * erc-backend.el: Only require `erc' during compilation (bug#12740). 2012-10-18 Stefan Monnier From e483264ca56201eb40858242aebd2c66419fb365 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 28 Oct 2012 11:52:42 -0400 Subject: [PATCH 073/109] * src/frame.c (x_set_font): Catch internal error. --- src/ChangeLog | 20 ++++++++++++-------- src/frame.c | 3 +++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7f036761011..41909a7a663 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,11 @@ +2012-10-28 Stefan Monnier + + * frame.c (x_set_font): Catch internal error. + 2012-10-27 Eli Zaretskii - Avoid overflow in w32 implementation of interval timers. When - possible, for ITIMER_PROF count only times the main thread + Avoid overflow in w32 implementation of interval timers. + When possible, for ITIMER_PROF count only times the main thread actually executes. * w32proc.c : 'expire' and 'reload' are now 'volatile ULONGLONG' types. All the other data which was @@ -11,8 +15,8 @@ for the timer. (timer_loop): Enter critical section when accessing ULONGLONG values of the itimer_data struct, as these accesses are no longer - atomic. Call 'w32_get_timer_time' instead of 'clock'. Remove - unused variable. + atomic. Call 'w32_get_timer_time' instead of 'clock'. + Remove unused variable. (init_timers): Initialize s_pfn_Get_Thread_Times. (start_timer_thread): Don't assign itimer->caller_thread here. (getitimer): Assign itimer->caller_thread here. @@ -92,8 +96,8 @@ 2012-10-19 Eli Zaretskii - * puresize.h (BASE_PURESIZE): Bump the base value to 1700000. See - http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html + * puresize.h (BASE_PURESIZE): Bump the base value to 1700000. + See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html for the reasons. * alloc.c (NSTATICS): Decrease to 0x800. @@ -712,8 +716,8 @@ (ns_clear_frame_area): Remove resize handle code. * nsfns.m (ns_in_resize): Remove. - (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove - ns_in_resize check. + (x_set_icon_name, ns_set_name, ns_set_name_as_filename): + Remove ns_in_resize check. 2012-10-07 Paul Eggert 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) Lisp_Object ascii_font = fontset_ascii (fontset); Lisp_Object spec = font_spec_from_name (ascii_font); + if (NILP (spec)) + signal_error ("Invalid font name", ascii_font); + if (! font_match_p (spec, font_object)) fontset = -1; } From 64ccff5f0ed8f0347b30e8fb4bd9b18a6cbaf1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Sun, 28 Oct 2012 17:10:06 +0100 Subject: [PATCH 074/109] * nsterm.m (NO_APPDEFINED_DATA): New define. (last_appdefined_event_data): New variable (last_appdefined_event): Remove. (ns_select): Initialize t from last_appdefined_event_data instead of [last_appdefined_event data1]. (sendEvent:): Save [theEvent data1] to last_appdefined_event_data, remove last_appdefined_event. Fixes: debbugs:12698 --- src/ChangeLog | 10 ++++++++++ src/nsterm.m | 19 +++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 41909a7a663..d2c16fa8310 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-10-28 Jan Djärv + + * nsterm.m (NO_APPDEFINED_DATA): New define. + (last_appdefined_event_data): New variable + (last_appdefined_event): Remove. + (ns_select): Initialize t from last_appdefined_event_data instead + of [last_appdefined_event data1]. + (sendEvent:): Save [theEvent data1] to last_appdefined_event_data, + remove last_appdefined_event (Bug#12698). + 2012-10-28 Stefan Monnier * frame.c (x_set_font): Catch internal error. 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; /* event loop */ static BOOL send_appdefined = YES; -static NSEvent *last_appdefined_event = 0; +#define NO_APPDEFINED_DATA (-8) +static int last_appdefined_event_data = NO_APPDEFINED_DATA; static NSTimer *timed_entry = 0; static NSTimer *scroll_repeat_entry = nil; static fd_set select_readfds, select_writefds; @@ -3436,8 +3437,7 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds, -------------------------------------------------------------------------- */ { int result; - NSEvent *ev; - int k, nr = 0; + int t, k, nr = 0; struct input_event event; char c; @@ -3521,16 +3521,11 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds, } unblock_input (); - ev = last_appdefined_event; + t = last_appdefined_event_data; - if (ev) + if (t != NO_APPDEFINED_DATA) { - int t; - if ([ev type] != NSApplicationDefined) - emacs_abort (); - - t = [ev data1]; - last_appdefined_event = 0; + last_appdefined_event_data = NO_APPDEFINED_DATA; if (t == -2) { @@ -4307,7 +4302,7 @@ ns_term_shutdown (int sig) modal loop. Just defer it until later. */ if ([NSApp modalWindow] == nil) { - last_appdefined_event = theEvent; + last_appdefined_event_data = [theEvent data1]; [self stop: self]; } else From 640bf8ad44027d37f917d0927e50c2dfea254917 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 28 Oct 2012 19:42:52 +0200 Subject: [PATCH 075/109] Don't use CLOCKS_PER_SEC in w32 timers. src/w32proc.c (TIMER_TICKS_PER_SEC): New macro. (timer_loop, getitimer, setitimer): Use it instead of CLOCKS_PER_SEC, which is no longer pertinent, since we don't use 'clock'. (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a literal 10000. --- src/ChangeLog | 9 +++++++++ src/w32proc.c | 39 ++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d2c16fa8310..beec867d333 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-10-28 Eli Zaretskii + + * w32proc.c (TIMER_TICKS_PER_SEC): New macro. + (timer_loop, getitimer, setitimer): Use it instead of + CLOCKS_PER_SEC, which is no longer pertinent, since we don't use + 'clock'. + (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a + literal 10000. + 2012-10-28 Jan Djärv * nsterm.m (NO_APPDEFINED_DATA): New define. diff --git a/src/w32proc.c b/src/w32proc.c index e2187d52425..d45d9879a24 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -272,6 +272,9 @@ typedef BOOL (WINAPI *GetThreadTimes_Proc) ( static GetThreadTimes_Proc s_pfn_Get_Thread_Times; +#define MAX_SINGLE_SLEEP 30 +#define TIMER_TICKS_PER_SEC 1000 + /* Return a suitable time value, in 1-ms units, for THREAD, a handle to a thread. If THREAD is NULL or an invalid handle, return the current wall-clock time since January 1, 1601 (UTC). Otherwise, @@ -282,6 +285,8 @@ w32_get_timer_time (HANDLE thread) { ULONGLONG retval; int use_system_time = 1; + /* The functions below return times in 100-ns units. */ + const int tscale = 10 * TIMER_TICKS_PER_SEC; if (thread && thread != INVALID_HANDLE_VALUE && s_pfn_Get_Thread_Times != NULL) @@ -300,8 +305,8 @@ w32_get_timer_time (HANDLE thread) temp_user.LowPart = user_ftime.dwLowDateTime; temp_user.HighPart = user_ftime.dwHighDateTime; retval = - temp_creation.QuadPart / 10000 + temp_kernel.QuadPart / 10000 - + temp_user.QuadPart / 10000; + temp_creation.QuadPart / tscale + temp_kernel.QuadPart / tscale + + temp_user.QuadPart / tscale; } else DebPrint (("GetThreadTimes failed with error code %lu\n", @@ -318,14 +323,12 @@ w32_get_timer_time (HANDLE thread) temp.LowPart = current_ftime.dwLowDateTime; temp.HighPart = current_ftime.dwHighDateTime; - retval = temp.QuadPart / 10000; + retval = temp.QuadPart / tscale; } return retval; } -#define MAX_SINGLE_SLEEP 30 - /* Thread function for a timer thread. */ static DWORD WINAPI timer_loop (LPVOID arg) @@ -334,7 +337,7 @@ timer_loop (LPVOID arg) int which = itimer->type; int sig = (which == ITIMER_REAL) ? SIGALRM : SIGPROF; CRITICAL_SECTION *crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; - const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / CLOCKS_PER_SEC; + const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / TIMER_TICKS_PER_SEC; HANDLE hth = (which == ITIMER_REAL) ? NULL : itimer->caller_thread; while (1) @@ -379,7 +382,7 @@ timer_loop (LPVOID arg) return 0; if (sleep_time > 0) { - Sleep (sleep_time * 1000 / CLOCKS_PER_SEC); + Sleep (sleep_time * 1000 / TIMER_TICKS_PER_SEC); /* Always sleep past the expiration time, to make sure we never call the handler _before_ the expiration time, always slightly after it. Sleep(5) makes sure we don't @@ -629,11 +632,13 @@ getitimer (int which, struct itimerval *value) if (expire) expire -= ticks_now; - value->it_value.tv_sec = expire / CLOCKS_PER_SEC; - usecs = (expire % CLOCKS_PER_SEC) * (__int64)1000000 / CLOCKS_PER_SEC; + value->it_value.tv_sec = expire / TIMER_TICKS_PER_SEC; + usecs = + (expire % TIMER_TICKS_PER_SEC) * (__int64)1000000 / TIMER_TICKS_PER_SEC; value->it_value.tv_usec = usecs; - value->it_interval.tv_sec = reload / CLOCKS_PER_SEC; - usecs = (reload % CLOCKS_PER_SEC) * (__int64)1000000 / CLOCKS_PER_SEC; + value->it_interval.tv_sec = reload / TIMER_TICKS_PER_SEC; + usecs = + (reload % TIMER_TICKS_PER_SEC) * (__int64)1000000 / TIMER_TICKS_PER_SEC; value->it_interval.tv_usec= usecs; return 0; @@ -690,26 +695,26 @@ setitimer(int which, struct itimerval *value, struct itimerval *ovalue) return 0; } - reload = value->it_interval.tv_sec * CLOCKS_PER_SEC; + reload = value->it_interval.tv_sec * TIMER_TICKS_PER_SEC; usecs = value->it_interval.tv_usec; if (value->it_interval.tv_sec == 0 - && usecs && usecs * CLOCKS_PER_SEC < clocks_min * 1000000) + && usecs && usecs * TIMER_TICKS_PER_SEC < clocks_min * 1000000) reload = clocks_min; else { - usecs *= CLOCKS_PER_SEC; + usecs *= TIMER_TICKS_PER_SEC; reload += usecs / 1000000; } - expire = value->it_value.tv_sec * CLOCKS_PER_SEC; + expire = value->it_value.tv_sec * TIMER_TICKS_PER_SEC; usecs = value->it_value.tv_usec; if (value->it_value.tv_sec == 0 - && usecs * CLOCKS_PER_SEC < clocks_min * 1000000) + && usecs * TIMER_TICKS_PER_SEC < clocks_min * 1000000) expire = clocks_min; else { - usecs *= CLOCKS_PER_SEC; + usecs *= TIMER_TICKS_PER_SEC; expire += usecs / 1000000; } From 86957a0cd3f273a83ce6584dcbaf513c2db429dc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 28 Oct 2012 14:48:17 -0400 Subject: [PATCH 076/109] * lisp/minibuffer.el (completion--sifn-requote): Rewrite to handle things like Tramp's "/foo:~bar//baz" -> "/scpc:foo:/baz" mapping. Fixes: debbugs:11714 --- lisp/ChangeLog | 3 ++ lisp/minibuffer.el | 80 ++++++++++++++++++++++------------------------ 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c52ed5e6e8b..74e63b140c4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-28 Stefan Monnier + * minibuffer.el (completion--sifn-requote): Rewrite to handle things + like Tramp's "/foo:~bar//baz" -> "/scpc:foo:/baz" mapping (bug#11714). + * tmm.el (tmm-prompt): Use map-keymap (bug#12744). 2012-10-27 Eli Zaretskii diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 52c3a0ba659..420d8f9d0fd 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." ;; that `concat' and `unquote' commute (which tends to be the case). ;; And we ask `requote' to do the work of mapping from unquoted positions ;; back to quoted positions. + ;; FIXME: For some forms of "quoting" such as the truncation behavior of + ;; substitute-in-file-name, it would be desirable not to requote completely. "Return a new completion table operating on quoted text. TABLE operates on the unquoted text. UNQUOTE is a function that takes a string and returns a new unquoted string. @@ -2161,53 +2163,49 @@ same as `substitute-in-file-name'." "use the regular PRED argument" "23.2") (defun completion--sifn-requote (upos qstr) - ;; We're looking for `qupos' such that: + ;; We're looking for `qpos' such that: ;; (equal (substring (substitute-in-file-name qstr) 0 upos) - ;; (substitute-in-file-name (substring qstr 0 qupos))) + ;; (substitute-in-file-name (substring qstr 0 qpos))) ;; Big problem here: we have to reverse engineer substitute-in-file-name to ;; find the position corresponding to UPOS in QSTR, but ;; substitute-in-file-name can do anything, depending on file-name-handlers. + ;; substitute-in-file-name does the following kind of things: + ;; - expand env-var references. + ;; - turn backslashes into slashes. + ;; - truncate some prefix of the input. + ;; - rewrite some prefix. + ;; Some of these operations are written in external libraries and we'd rather + ;; not hard code any assumptions here about what they actually do. IOW, we + ;; want to treat substitute-in-file-name as a black box, as much as possible. ;; Kind of like in rfn-eshadow-update-overlay, only worse. - ;; FIXME: example of thing we do not handle: Tramp's makes - ;; (substitute-in-file-name "/foo:~/bar//baz") -> "/scpc:foo:/baz". - ;; FIXME: One way to try and handle "all" cases is to require - ;; substitute-in-file-name to preserve text-properties, so we could - ;; apply text-properties to the input string and then look for them in - ;; the output to understand what comes from where. - (let ((qpos 0)) - ;; Handle substitute-in-file-name's truncation behavior. - (let (tpos) - (while (and (string-match "[\\/][~/\\]" qstr qpos) - ;; Hopefully our regexp covers all truncation cases. - ;; Also let's make sure sifn indeed truncates here. + ;; Example of things we need to handle: + ;; - Tramp (substitute-in-file-name "/foo:~/bar//baz") => "/scpc:foo:/baz". + ;; - Cygwin (substitute-in-file-name "C:\bin") => "/usr/bin" + ;; (substitute-in-file-name "C:\") => "/" + ;; (substitute-in-file-name "C:\bi") => "/bi" + (let* ((ustr (substitute-in-file-name qstr)) + (uprefix (substring ustr 0 upos)) + qprefix) + ;; Main assumption: nothing after qpos should affect the text before upos, + ;; so we can work our way backward from the end of qstr, one character + ;; at a time. + ;; Second assumptions: If qpos is far from the end this can be a bit slow, + ;; so we speed it up by doing a first loop that skips a word at a time. + ;; This word-sized loop is careful not to cut in the middle of env-vars. + (while (let ((boundary (string-match "\\(\\$+{?\\)?\\w+\\W*\\'" qstr))) + (and boundary (progn - (setq tpos (1+ (match-beginning 0))) - (equal (substitute-in-file-name qstr) - (substitute-in-file-name (substring qstr tpos))))) - (setq qpos tpos))) - ;; `upos' is relative to the position corresponding to `qpos' in - ;; (substitute-in-file-name qstr), so as qpos moves forward, upos - ;; gets smaller. - (while (and (> upos 0) - (string-match "\\$\\(\\$\\|\\([[:alnum:]_]+\\|{[^}]*}\\)\\)?" - qstr qpos)) - (cond - ((>= (- (match-beginning 0) qpos) upos) ; UPOS is before current match. - (setq qpos (+ qpos upos)) - (setq upos 0)) - ((not (match-end 1)) ;A sole $: probably an error. - (setq upos (- upos (- (match-end 0) qpos))) - (setq qpos (match-end 0))) - (t - (setq upos (- upos (- (match-beginning 0) qpos))) - (setq qpos (match-end 0)) - (setq upos (- upos (length (substitute-in-file-name - (match-string 0 qstr)))))))) - ;; If `upos' is negative, it's because it's within the expansion of an - ;; envvar, i.e. there is no exactly matching qpos, so we just use the next - ;; available qpos right after the envvar. - (cons (if (>= upos 0) (+ qpos upos) qpos) - #'minibuffer--double-dollars))) + (setq qprefix (substring qstr 0 boundary)) + (string-prefix-p uprefix + (substitute-in-file-name qprefix))))) + (setq qstr qprefix)) + (let ((qpos (length qstr))) + (while (and (> qpos 0) + (string-prefix-p uprefix + (substitute-in-file-name + (substring qstr 0 (1- qpos))))) + (setq qpos (1- qpos))) + (cons qpos #'minibuffer--double-dollars)))) (defalias 'completion--file-name-table (completion-table-with-quoting #'completion-file-name-table From b9383404934cc07ec1f92b0354a559ed44cf4b2c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 28 Oct 2012 15:07:52 -0400 Subject: [PATCH 077/109] * lisp/minibuffer.el (completion--twq-all): Disable too-strict assertions. Fixes: debbugs:11714 --- lisp/ChangeLog | 1 + lisp/minibuffer.el | 28 ++++++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 74e63b140c4..2bdf074b9d5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * minibuffer.el (completion--sifn-requote): Rewrite to handle things like Tramp's "/foo:~bar//baz" -> "/scpc:foo:/baz" mapping (bug#11714). + (completion--twq-all): Disable too-strict assertions. * tmm.el (tmm-prompt): Use map-keymap (bug#12744). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 420d8f9d0fd..38347f23f7d 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -529,10 +529,12 @@ for use at QPOS." (`(,qfullpos . ,qfun) (funcall requote (+ boundary (length prefix)) string)) (qfullprefix (substring string 0 qfullpos)) - (_ (cl-assert (completion--string-equal-p - (funcall unquote qfullprefix) - (concat (substring ustring 0 boundary) prefix)) - t)) + ;; FIXME: This assertion can be wrong, e.g. in Cygwin, where + ;; (unquote "c:\bin") => "/usr/bin" but (unquote "c:\") => "/". + ;;(cl-assert (completion--string-equal-p + ;; (funcall unquote qfullprefix) + ;; (concat (substring ustring 0 boundary) prefix)) + ;; t)) (qboundary (car (funcall requote boundary string))) (_ (cl-assert (<= qboundary qfullpos))) ;; FIXME: this split/quote/concat business messes up the carefully @@ -561,14 +563,16 @@ for use at QPOS." (let* ((new (substring completion (length prefix))) (qnew (funcall qfun new)) (qcompletion (concat qprefix qnew))) - (cl-assert - (completion--string-equal-p - (funcall unquote - (concat (substring string 0 qboundary) - qcompletion)) - (concat (substring ustring 0 boundary) - completion)) - t) + ;; FIXME: Similarly here, Cygwin's mapping trips this + ;; assertion. + ;;(cl-assert + ;; (completion--string-equal-p + ;; (funcall unquote + ;; (concat (substring string 0 qboundary) + ;; qcompletion)) + ;; (concat (substring ustring 0 boundary) + ;; completion)) + ;; t) qcompletion)) completions) qboundary)))) From cd44022cb0f1a126f74a45b98302185262d19396 Mon Sep 17 00:00:00 2001 From: Daniel Hackney Date: Sun, 28 Oct 2012 16:41:49 -0400 Subject: [PATCH 078/109] * lisp/emacs-lisp/package.el (package-generate-autoloads): Kill buffer "PKGNAME-autoloads.el" in case we created it. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/package.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2bdf074b9d5..999a06648ac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-28 Daniel Hackney + + * emacs-lisp/package.el (package-generate-autoloads): Kill buffer + "PKGNAME-autoloads.el" in case we created it. + 2012-10-28 Stefan Monnier * minibuffer.el (completion--sifn-requote): Rewrite to handle things diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 303642b5bec..6629410a1f1 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -590,7 +590,9 @@ EXTRA-PROPERTIES is currently unused." (version-control 'never)) (unless (fboundp 'autoload-ensure-default-file) (package-autoload-ensure-default-file generated-autoload-file)) - (update-directory-autoloads pkg-dir))) + (update-directory-autoloads pkg-dir) + (let ((buf (find-buffer-visiting generated-autoload-file))) + (when buf (kill-buffer buf))))) (defvar tar-parse-info) (declare-function tar-untar-buffer "tar-mode" ()) From b3871e59da478e32561f9c09e61ed1383d51a0c5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 28 Oct 2012 20:06:39 -0400 Subject: [PATCH 079/109] * lisp/progmodes/sh-script.el (sh-font-lock-paren): Also put punctuation syntax to the matching opener, if any. (sh-smie-sh-forward-token, sh-smie-sh-backward-token): Recognize this matching open as a "case-(". (sh-smie-rc-grammar): Add a corresponding rule for it. Fixes: debbugs:12547 --- lisp/ChangeLog | 8 +++ lisp/progmodes/sh-script.el | 99 ++++++++++++++++++++----------------- 2 files changed, 62 insertions(+), 45 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 999a06648ac..3265f8acf41 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-10-29 Stefan Monnier + + * progmodes/sh-script.el (sh-font-lock-paren): Also put punctuation + syntax to the matching opener, if any (bug#12547). + (sh-smie-sh-forward-token, sh-smie-sh-backward-token): Recognize this + matching open as a "case-(". + (sh-smie-rc-grammar): Add a corresponding rule for it. + 2012-10-28 Daniel Hackney * emacs-lisp/package.el (package-generate-autoloads): Kill buffer 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." (defun sh-font-lock-paren (start) (unless (nth 8 (syntax-ppss)) (save-excursion - (goto-char start) - ;; Skip through all patterns - (while - (progn - (while - (progn - (forward-comment (- (point-max))) - (when (and (eolp) (sh-is-quoted-p (point))) - (forward-char -1) - t))) - ;; Skip through one pattern - (while - (or (/= 0 (skip-syntax-backward "w_")) - (/= 0 (skip-chars-backward "-$=?[]*@/\\\\")) - (and (sh-is-quoted-p (1- (point))) - (goto-char (- (point) 2))) - (when (memq (char-before) '(?\" ?\' ?\})) - (condition-case nil (progn (backward-sexp 1) t) - (error nil))))) - ;; Patterns can be preceded by an open-paren (Bug#1320). - (if (eq (char-before (point)) ?\() + (let ((open nil)) + (goto-char start) + ;; Skip through all patterns + (while + (progn + (while + (progn + (forward-comment (- (point-max))) + (when (and (eolp) (sh-is-quoted-p (point))) + (forward-char -1) + t))) + ;; Skip through one pattern + (while + (or (/= 0 (skip-syntax-backward "w_")) + (/= 0 (skip-chars-backward "-$=?[]*@/\\\\")) + (and (sh-is-quoted-p (1- (point))) + (goto-char (- (point) 2))) + (when (memq (char-before) '(?\" ?\' ?\})) + (condition-case nil (progn (backward-sexp 1) t) + (error nil))))) + ;; Patterns can be preceded by an open-paren (bug#1320). + (when (eq (char-before (point)) ?\() + (backward-char 1) + (setq open (point))) + (while (progn + (forward-comment (- (point-max))) + ;; Maybe we've bumped into an escaped newline. + (sh-is-quoted-p (point))) (backward-char 1)) - (while (progn - (forward-comment (- (point-max))) - ;; Maybe we've bumped into an escaped newline. - (sh-is-quoted-p (point))) - (backward-char 1)) - (when (eq (char-before) ?|) - (backward-char 1) t))) - (and (> (point) (1+ (point-min))) - (progn (backward-char 2) - (if (> start (line-end-position)) - (put-text-property (point) (1+ start) - 'syntax-multiline t)) - ;; FIXME: The `in' may just be a random argument to - ;; a normal command rather than the real `in' keyword. - ;; I.e. we should look back to try and find the - ;; corresponding `case'. - (and (looking-at ";[;&]\\|\\_ (point) (1+ (point-min))) + (progn (backward-char 2) + (if (> start (line-end-position)) + (put-text-property (point) (1+ start) + 'syntax-multiline t)) + ;; FIXME: The `in' may just be a random argument to + ;; a normal command rather than the real `in' keyword. + ;; I.e. we should look back to try and find the + ;; corresponding `case'. + (and (looking-at ";[;&]\\|\\_ Date: Sun, 28 Oct 2012 18:06:13 -0700 Subject: [PATCH 080/109] * doc/misc/cl.texi (Organization): More details on cl-lib.el versus cl.el. --- doc/misc/ChangeLog | 4 ++++ doc/misc/cl.texi | 43 +++++++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index fe7781c57cc..8c9573aa00c 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,7 @@ +2012-10-29 Glenn Morris + + * cl.texi (Organization): More details on cl-lib.el versus cl.el. + 2012-10-28 Glenn Morris * cl.texi (Multiple Values, Common Lisp Compatibility): diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index ed4206c0b97..615a703f925 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -182,17 +182,30 @@ All you have to do is @code{(require 'cl-lib)}, and @file{cl-lib.el} will take care of pulling in the other files when they are needed. -There is another file, @file{cl.el}, which was the main entry point -to the CL package prior to Emacs 24.3. Nowadays, it is replaced -by @file{cl-lib.el}. The two provide the same features, but use -different function names (in fact, @file{cl.el} just defines aliases -to the @file{cl-lib.el} definitions). In particular, the old @file{cl.el} -does not use a clean namespace. For this reason, Emacs has a policy -that packages distributed with Emacs must not load @code{cl} at run time. -(It is ok for them to load @code{cl} at @emph{compile} time, with -@code{eval-when-compile}, and use the macros it provides.) There is -no such restriction on the use of @code{cl-lib}. New code should use -@code{cl-lib} rather than @code{cl}. @xref{Naming Conventions}. +There is another file, @file{cl.el}, which was the main entry point to +the CL package prior to Emacs 24.3. Nowadays, it is replaced by +@file{cl-lib.el}. The two provide the same features (in most cases), +but use different function names (in fact, @file{cl.el} mainly just +defines aliases to the @file{cl-lib.el} definitions). Where +@file{cl-lib.el} defines a function called, for example, +@code{cl-incf}, @file{cl.el} uses the same name but without the +@samp{cl-} prefix, e.g. @code{incf} in this example. There are a few +exceptions to this. First, functions such as @code{cl-defun} where +the unprefixed version was already used for a standard Emacs Lisp +function. In such cases, the @file{cl.el} version adds a @samp{*} +suffix, e.g. @code{defun*}. Second, there are some obsolete features +that are only implemented in @file{cl.el}, not in @file{cl-lib.el}, +because they are replaced by other standard Emacs Lisp features. +Finally, in a very few cases the old @file{cl.el} versions do not +behave in exactly the same way as the @file{cl-lib.el} versions. +@xref{Obsolete Features}. + +Since the old @file{cl.el} does not use a clean namespace, Emacs has a +policy that packages distributed with Emacs must not load @code{cl} at +run time. (It is ok for them to load @code{cl} at @emph{compile} +time, with @code{eval-when-compile}, and use the macros it provides.) +There is no such restriction on the use of @code{cl-lib}. New code +should use @code{cl-lib} rather than @code{cl}. There is one more file, @file{cl-compat.el}, which defines some routines from the older Quiroz CL package that are not otherwise @@ -4666,13 +4679,6 @@ referenced by @code{cl-return} or @code{cl-return-from} inside the block. Following is a list of all known incompatibilities between this package and Common Lisp as documented in Steele (2nd edition). -@ignore -Certain function names, such as @code{member}, @code{assoc}, and -@code{floor}, were already taken by (incompatible) Emacs Lisp -functions; this package appends @samp{*} to the names of its -Common Lisp versions of these functions. -@end ignore - The word @code{cl-defun} is required instead of @code{defun} in order to use extended Common Lisp argument lists in a function. Likewise, @code{cl-defmacro} and @code{cl-function} are versions of those forms @@ -4684,6 +4690,7 @@ The @code{equal} predicate does not distinguish between IEEE floating-point plus and minus zero. The @code{cl-equalp} predicate has several differences with Common Lisp; @pxref{Predicates}. +@c FIXME no longer provided by cl. The @code{setf} mechanism is entirely compatible, except that setf-methods return a list of five values rather than five values directly. Also, the new ``@code{setf} function'' concept From a0ccbcbddcdf0c7cb990341fd1b9947c08eaaa15 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 28 Oct 2012 18:12:53 -0700 Subject: [PATCH 081/109] * lisp/emacs-lisp/cl.el (defsetf): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/cl.el | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3265f8acf41..76cc7e52863 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-29 Glenn Morris + + * emacs-lisp/cl.el (defsetf): Doc fix. + 2012-10-29 Stefan Monnier * progmodes/sh-script.el (sh-font-lock-paren): Also put punctuation diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 34beed0d9ef..a558e505e66 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -568,9 +568,9 @@ well for simple place forms. In the simple `defsetf' form, `setf's of the form (setf (NAME ARGS...) VAL) are transformed to function or macro calls of the form (FUNC ARGS... VAL). Example: - (cl-defsetf aref aset) + (defsetf aref aset) -Alternate form: (cl-defsetf NAME ARGLIST (STORE) BODY...). +Alternate form: (defsetf NAME ARGLIST (STORE) BODY...). Here, the above `setf' call is expanded by binding the argument forms ARGS according to ARGLIST, binding the value form VAL to STORE, then executing BODY, which must return a Lisp form that does the necessary `setf' operation. @@ -578,7 +578,7 @@ Actually, ARGLIST and STORE may be bound to temporary variables which are introduced automatically to preserve proper execution order of the arguments. Example: - (cl-defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v)) + (defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v)) \(fn NAME [FUNC | ARGLIST (STORE) BODY...])" (declare (debug From f1e1b6f3d38175ac7f84d9136bd5b8d4bc9f74e7 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 28 Oct 2012 18:14:50 -0700 Subject: [PATCH 082/109] Doc fix (use an alias to be consistent with the rest of this manual) --- doc/misc/cl.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 615a703f925..f05d72362d3 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -5089,7 +5089,7 @@ This section describes some obsolete ways to extend @code{setf}. They are replaced by @file{gv.el} in Emacs 24.3. @c FIXME. -@defmac define-setf-expander name arglist &rest body +@defmac define-setf-method name arglist &rest body Use @file{gv.el}. @end defmac From a3c5b619fc4c1334c4d295def008318ae0e9bca7 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 28 Oct 2012 18:19:26 -0700 Subject: [PATCH 083/109] * cl.texi (Setf Extensions): Remove `apply' setf since it seems to be disabled. --- doc/misc/ChangeLog | 1 + doc/misc/cl.texi | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 8c9573aa00c..9aeaf87426e 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,6 +1,7 @@ 2012-10-29 Glenn Morris * cl.texi (Organization): More details on cl-lib.el versus cl.el. + (Setf Extensions): Remove `apply' setf since it seems to be disabled. 2012-10-28 Glenn Morris diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index f05d72362d3..b77dfcd94be 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -964,6 +964,8 @@ also works in this way by replacing a portion of the current buffer. @c FIXME? Also `eq'? (see cl-lib.el) +@c Currently commented out in cl.el. +@ignore @item A call of the form @code{(apply '@var{func} @dots{})} or @code{(apply (function @var{func}) @dots{})}, where @var{func} @@ -972,6 +974,7 @@ in the sense described in Steele's book; since none of the standard Emacs place functions are suitable in this sense, this feature is only interesting when used with places you define yourself with @code{define-setf-method} or the long form of @code{defsetf}. +@end ignore @item A macro call, in which case the macro is expanded and @code{setf} @@ -979,7 +982,7 @@ is applied to the resulting form. @item Any form for which a @code{defsetf} or @code{define-setf-method} -has been made. +has been made. @xref{Obsolete Setf Customization}. @end itemize @c FIXME should this be in lispref? It seems self-evident. From d571e9c385d648a90581e2c5cd1a883b8c0ea0e4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 28 Oct 2012 18:29:22 -0700 Subject: [PATCH 084/109] Move some cl.texi setf extensions to the Obsolete appendix * doc/misc/cl.texi (Customizing Setf): Move contents to "Obsolete Setf Customization". (Modify Macros, Multiple Values): Remove mentions of obsolete feature. --- doc/misc/ChangeLog | 2 + doc/misc/cl.texi | 425 ++++++++++++++++++++++----------------------- 2 files changed, 205 insertions(+), 222 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 9aeaf87426e..e85e18ff5c7 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -2,6 +2,8 @@ * cl.texi (Organization): More details on cl-lib.el versus cl.el. (Setf Extensions): Remove `apply' setf since it seems to be disabled. + (Customizing Setf): Move contents to "Obsolete Setf Customization". + (Modify Macros, Multiple Values): Remove mentions of obsolete feature. 2012-10-28 Glenn Morris diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index b77dfcd94be..086cc25fbcc 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -883,7 +883,6 @@ generalized variables. @menu * Setf Extensions:: Additional @code{setf} places. * Modify Macros:: @code{cl-incf}, @code{cl-rotatef}, @code{letf}, @code{cl-callf}, etc. -* Customizing Setf:: @code{define-modify-macro}, @code{defsetf}, @code{define-setf-method}. @end menu @node Setf Extensions @@ -1198,9 +1197,7 @@ Some more examples: (cl-callf cl-union happy-people (list joe bob) :test 'same-person) @end example -@xref{Customizing Setf}, for @code{define-modify-macro}, a way -to create even more concise notations for modify macros. Note -again that @code{cl-callf} is an extension to standard Common Lisp. +Note again that @code{cl-callf} is an extension to standard Common Lisp. @end defmac @defmac cl-callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} @@ -1216,214 +1213,6 @@ blocks for other macros like @code{cl-incf}, @code{cl-pushnew}, and macros are used in the processing of symbol macros; @pxref{Macro Bindings}. -@node Customizing Setf -@subsection Customizing Setf - -@noindent -Common Lisp defines three macros, @code{define-modify-macro}, -@code{defsetf}, and @code{define-setf-method}, that allow the -user to extend generalized variables in various ways. - -@defmac define-modify-macro name arglist function [doc-string] -This macro defines a ``read-modify-write'' macro similar to -@code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined -to take a @var{place} argument followed by additional arguments -described by @var{arglist}. The call - -@example -(@var{name} @var{place} @var{args}...) -@end example - -@noindent -will be expanded to - -@example -(cl-callf @var{func} @var{place} @var{args}...) -@end example - -@noindent -which in turn is roughly equivalent to - -@example -(setf @var{place} (@var{func} @var{place} @var{args}...)) -@end example - -For example: - -@example -(define-modify-macro cl-incf (&optional (n 1)) +) -(define-modify-macro cl-concatf (&rest args) concat) -@end example - -Note that @code{&key} is not allowed in @var{arglist}, but -@code{&rest} is sufficient to pass keywords on to the function. - -Most of the modify macros defined by Common Lisp do not exactly -follow the pattern of @code{define-modify-macro}. For example, -@code{push} takes its arguments in the wrong order, and @code{pop} -is completely irregular. You can define these macros ``by hand'' -using @code{get-setf-method}, or consult the source -to see how to use the internal @code{setf} building blocks. -@end defmac - -@defmac defsetf access-fn update-fn -This is the simpler of two @code{defsetf} forms. Where -@var{access-fn} is the name of a function which accesses a place, -this declares @var{update-fn} to be the corresponding store -function. From now on, - -@example -(setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) -@end example - -@noindent -will be expanded to - -@example -(@var{update-fn} @var{arg1} @var{arg2} @var{arg3} @var{value}) -@end example - -@noindent -The @var{update-fn} is required to be either a true function, or -a macro which evaluates its arguments in a function-like way. Also, -the @var{update-fn} is expected to return @var{value} as its result. -Otherwise, the above expansion would not obey the rules for the way -@code{setf} is supposed to behave. - -As a special (non-Common-Lisp) extension, a third argument of @code{t} -to @code{defsetf} says that the @code{update-fn}'s return value is -not suitable, so that the above @code{setf} should be expanded to -something more like - -@example -(let ((temp @var{value})) - (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} temp) - temp) -@end example - -Some examples of the use of @code{defsetf}, drawn from the standard -suite of setf methods, are: - -@example -(defsetf car setcar) -(defsetf symbol-value set) -(defsetf buffer-name rename-buffer t) -@end example -@end defmac - -@defmac defsetf access-fn arglist (store-var) forms@dots{} -This is the second, more complex, form of @code{defsetf}. It is -rather like @code{defmacro} except for the additional @var{store-var} -argument. The @var{forms} should return a Lisp form which stores -the value of @var{store-var} into the generalized variable formed -by a call to @var{access-fn} with arguments described by @var{arglist}. -The @var{forms} may begin with a string which documents the @code{setf} -method (analogous to the doc string that appears at the front of a -function). - -For example, the simple form of @code{defsetf} is shorthand for - -@example -(defsetf @var{access-fn} (&rest args) (store) - (append '(@var{update-fn}) args (list store))) -@end example - -The Lisp form that is returned can access the arguments from -@var{arglist} and @var{store-var} in an unrestricted fashion; -macros like @code{setf} and @code{cl-incf} which invoke this -setf-method will insert temporary variables as needed to make -sure the apparent order of evaluation is preserved. - -Another example drawn from the standard package: - -@example -(defsetf nth (n x) (store) - (list 'setcar (list 'nthcdr n x) store)) -@end example -@end defmac - -@defmac define-setf-method access-fn arglist forms@dots{} -This is the most general way to create new place forms. When -a @code{setf} to @var{access-fn} with arguments described by -@var{arglist} is expanded, the @var{forms} are evaluated and -must return a list of five items: - -@enumerate -@item -A list of @dfn{temporary variables}. - -@item -A list of @dfn{value forms} corresponding to the temporary variables -above. The temporary variables will be bound to these value forms -as the first step of any operation on the generalized variable. - -@item -A list of exactly one @dfn{store variable} (generally obtained -from a call to @code{gensym}). - -@item -A Lisp form which stores the contents of the store variable into -the generalized variable, assuming the temporaries have been -bound as described above. - -@item -A Lisp form which accesses the contents of the generalized variable, -assuming the temporaries have been bound. -@end enumerate - -This is exactly like the Common Lisp macro of the same name, -except that the method returns a list of five values rather -than the five values themselves, since Emacs Lisp does not -support Common Lisp's notion of multiple return values. - -Once again, the @var{forms} may begin with a documentation string. - -A setf-method should be maximally conservative with regard to -temporary variables. In the setf-methods generated by -@code{defsetf}, the second return value is simply the list of -arguments in the place form, and the first return value is a -list of a corresponding number of temporary variables generated -by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which -use this setf-method will optimize away most temporaries that -turn out to be unnecessary, so there is little reason for the -setf-method itself to optimize. -@end defmac - -@defun get-setf-method place &optional env -This function returns the setf-method for @var{place}, by -invoking the definition previously recorded by @code{defsetf} -or @code{define-setf-method}. The result is a list of five -values as described above. You can use this function to build -your own @code{cl-incf}-like modify macros. (Actually, it is -@c FIXME? -better to use the internal functions @code{cl-setf-do-modify} -and @code{cl-setf-do-store}, which are a bit easier to use and -which also do a number of optimizations; consult the source -code for the @code{cl-incf} function for a simple example.) - -The argument @var{env} specifies the ``environment'' to be -passed on to @code{macroexpand} if @code{get-setf-method} should -need to expand a macro in @var{place}. It should come from -an @code{&environment} argument to the macro or setf-method -that called @code{get-setf-method}. - -See also the source code for the setf-methods for @code{apply} -and @code{substring}, each of which works by calling -@code{get-setf-method} on a simpler case, then massaging -the result in various ways. -@end defun - -Modern Common Lisp defines a second, independent way to specify -the @code{setf} behavior of a function, namely ``@code{setf} -functions'' whose names are lists @code{(setf @var{name})} -rather than symbols. For example, @code{(defun (setf foo) @dots{})} -defines the function that is used when @code{setf} is applied to -@code{foo}. This package does not currently support @code{setf} -functions. In particular, it is a compile-time error to use -@code{setf} on a form which has not already been @code{defsetf}'d -or otherwise declared; in newer Common Lisps, this would not be -an error since the function @code{(setf @var{func})} might be -defined later. @node Variable Bindings @section Variable Bindings @@ -2672,8 +2461,8 @@ functions, by contrast, always return exactly one result. This package makes no attempt to emulate Common Lisp multiple return values; Emacs versions of Common Lisp functions that return more than one value either return just the first value (as in -@code{cl-compiler-macroexpand}) or return a list of values (as in -@code{get-setf-method}). This package @emph{does} define placeholders +@code{cl-compiler-macroexpand}) or return a list of values. +This package @emph{does} define placeholders for the Common Lisp functions that work with multiple values, but in Emacs Lisp these functions simply operate on lists instead. The @code{cl-values} form, for example, is a synonym for @code{list} @@ -5088,22 +4877,214 @@ Replaced by @code{cl-letf} (@pxref{Modify Macros}). @node Obsolete Setf Customization @appendixsec Obsolete Ways to Customize Setf -This section describes some obsolete ways to extend @code{setf}. -They are replaced by @file{gv.el} in Emacs 24.3. +Common Lisp defines three macros, @code{define-modify-macro}, +@code{defsetf}, and @code{define-setf-method}, that allow the +user to extend generalized variables in various ways. +In Emacs, these are obsolete, replaced by various features of +@file{gv.el} in Emacs 24.3. +@c FIXME details. -@c FIXME. -@defmac define-setf-method name arglist &rest body -Use @file{gv.el}. +@defmac define-modify-macro name arglist function [doc-string] +This macro defines a ``read-modify-write'' macro similar to +@code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined +to take a @var{place} argument followed by additional arguments +described by @var{arglist}. The call + +@example +(@var{name} @var{place} @var{args}...) +@end example + +@noindent +will be expanded to + +@example +(cl-callf @var{func} @var{place} @var{args}...) +@end example + +@noindent +which in turn is roughly equivalent to + +@example +(setf @var{place} (@var{func} @var{place} @var{args}...)) +@end example + +For example: + +@example +(define-modify-macro cl-incf (&optional (n 1)) +) +(define-modify-macro cl-concatf (&rest args) concat) +@end example + +Note that @code{&key} is not allowed in @var{arglist}, but +@code{&rest} is sufficient to pass keywords on to the function. + +Most of the modify macros defined by Common Lisp do not exactly +follow the pattern of @code{define-modify-macro}. For example, +@code{push} takes its arguments in the wrong order, and @code{pop} +is completely irregular. You can define these macros ``by hand'' +using @code{get-setf-method}, or consult the source +to see how to use the internal @code{setf} building blocks. @end defmac @defmac defsetf access-fn update-fn -Use @file{gv.el}. +This is the simpler of two @code{defsetf} forms. Where +@var{access-fn} is the name of a function which accesses a place, +this declares @var{update-fn} to be the corresponding store +function. From now on, + +@example +(setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) +@end example + +@noindent +will be expanded to + +@example +(@var{update-fn} @var{arg1} @var{arg2} @var{arg3} @var{value}) +@end example + +@noindent +The @var{update-fn} is required to be either a true function, or +a macro which evaluates its arguments in a function-like way. Also, +the @var{update-fn} is expected to return @var{value} as its result. +Otherwise, the above expansion would not obey the rules for the way +@code{setf} is supposed to behave. + +As a special (non-Common-Lisp) extension, a third argument of @code{t} +to @code{defsetf} says that the @code{update-fn}'s return value is +not suitable, so that the above @code{setf} should be expanded to +something more like + +@example +(let ((temp @var{value})) + (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} temp) + temp) +@end example + +Some examples of the use of @code{defsetf}, drawn from the standard +suite of setf methods, are: + +@example +(defsetf car setcar) +(defsetf symbol-value set) +(defsetf buffer-name rename-buffer t) +@end example @end defmac -@defmac define-modify-macro name arglist function [doc-string] -Use @file{gv.el}. +@defmac defsetf access-fn arglist (store-var) forms@dots{} +This is the second, more complex, form of @code{defsetf}. It is +rather like @code{defmacro} except for the additional @var{store-var} +argument. The @var{forms} should return a Lisp form which stores +the value of @var{store-var} into the generalized variable formed +by a call to @var{access-fn} with arguments described by @var{arglist}. +The @var{forms} may begin with a string which documents the @code{setf} +method (analogous to the doc string that appears at the front of a +function). + +For example, the simple form of @code{defsetf} is shorthand for + +@example +(defsetf @var{access-fn} (&rest args) (store) + (append '(@var{update-fn}) args (list store))) +@end example + +The Lisp form that is returned can access the arguments from +@var{arglist} and @var{store-var} in an unrestricted fashion; +macros like @code{setf} and @code{cl-incf} which invoke this +setf-method will insert temporary variables as needed to make +sure the apparent order of evaluation is preserved. + +Another example drawn from the standard package: + +@example +(defsetf nth (n x) (store) + (list 'setcar (list 'nthcdr n x) store)) +@end example @end defmac +@defmac define-setf-method access-fn arglist forms@dots{} +This is the most general way to create new place forms. When +a @code{setf} to @var{access-fn} with arguments described by +@var{arglist} is expanded, the @var{forms} are evaluated and +must return a list of five items: + +@enumerate +@item +A list of @dfn{temporary variables}. + +@item +A list of @dfn{value forms} corresponding to the temporary variables +above. The temporary variables will be bound to these value forms +as the first step of any operation on the generalized variable. + +@item +A list of exactly one @dfn{store variable} (generally obtained +from a call to @code{gensym}). + +@item +A Lisp form which stores the contents of the store variable into +the generalized variable, assuming the temporaries have been +bound as described above. + +@item +A Lisp form which accesses the contents of the generalized variable, +assuming the temporaries have been bound. +@end enumerate + +This is exactly like the Common Lisp macro of the same name, +except that the method returns a list of five values rather +than the five values themselves, since Emacs Lisp does not +support Common Lisp's notion of multiple return values. + +Once again, the @var{forms} may begin with a documentation string. + +A setf-method should be maximally conservative with regard to +temporary variables. In the setf-methods generated by +@code{defsetf}, the second return value is simply the list of +arguments in the place form, and the first return value is a +list of a corresponding number of temporary variables generated +by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which +use this setf-method will optimize away most temporaries that +turn out to be unnecessary, so there is little reason for the +setf-method itself to optimize. +@end defmac + +@defun get-setf-method place &optional env +This function returns the setf-method for @var{place}, by +invoking the definition previously recorded by @code{defsetf} +or @code{define-setf-method}. The result is a list of five +values as described above. You can use this function to build +your own @code{cl-incf}-like modify macros. (Actually, it is +@c FIXME? +better to use the internal functions @code{cl-setf-do-modify} +and @code{cl-setf-do-store}, which are a bit easier to use and +which also do a number of optimizations; consult the source +code for the @code{cl-incf} function for a simple example.) + +The argument @var{env} specifies the ``environment'' to be +passed on to @code{macroexpand} if @code{get-setf-method} should +need to expand a macro in @var{place}. It should come from +an @code{&environment} argument to the macro or setf-method +that called @code{get-setf-method}. + +See also the source code for the setf-methods for @code{apply} +and @code{substring}, each of which works by calling +@code{get-setf-method} on a simpler case, then massaging +the result in various ways. +@end defun + +Modern Common Lisp defines a second, independent way to specify +the @code{setf} behavior of a function, namely ``@code{setf} +functions'' whose names are lists @code{(setf @var{name})} +rather than symbols. For example, @code{(defun (setf foo) @dots{})} +defines the function that is used when @code{setf} is applied to +@code{foo}. This package does not currently support @code{setf} +functions. In particular, it is a compile-time error to use +@code{setf} on a form which has not already been @code{defsetf}'d +or otherwise declared; in newer Common Lisps, this would not be +an error since the function @code{(setf @var{func})} might be +defined later. + @node GNU Free Documentation License @appendix GNU Free Documentation License From 6a07d52ed8e21a1f17ed816c8f8348a5cafc02c8 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 28 Oct 2012 18:31:10 -0700 Subject: [PATCH 085/109] * doc/misc/cl.texi (Obsolete Setf Customization): Don't mention `apply' setf. --- doc/misc/ChangeLog | 1 + doc/misc/cl.texi | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index e85e18ff5c7..6d8799134a1 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -4,6 +4,7 @@ (Setf Extensions): Remove `apply' setf since it seems to be disabled. (Customizing Setf): Move contents to "Obsolete Setf Customization". (Modify Macros, Multiple Values): Remove mentions of obsolete feature. + (Obsolete Setf Customization): Don't mention `apply' setf. 2012-10-28 Glenn Morris diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 086cc25fbcc..0fc46840fae 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -5067,10 +5067,10 @@ need to expand a macro in @var{place}. It should come from an @code{&environment} argument to the macro or setf-method that called @code{get-setf-method}. -See also the source code for the setf-methods for @code{apply} -and @code{substring}, each of which works by calling -@code{get-setf-method} on a simpler case, then massaging -the result in various ways. +See also the source code for the setf-method for +@c Also @code{apply}, but that is commented out. +@code{substring}, which works by calling @code{get-setf-method} on a +simpler case, then massaging the result. @end defun Modern Common Lisp defines a second, independent way to specify From d55911cf1de25091a072642f8ef8dd3d1f4e47b8 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 28 Oct 2012 18:36:29 -0700 Subject: [PATCH 086/109] * cl.texi (Modify Macros, Other Clauses): Remove mentions of obsolete features. --- doc/misc/ChangeLog | 3 ++- doc/misc/cl.texi | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 6d8799134a1..92b5b243ec9 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -3,7 +3,8 @@ * cl.texi (Organization): More details on cl-lib.el versus cl.el. (Setf Extensions): Remove `apply' setf since it seems to be disabled. (Customizing Setf): Move contents to "Obsolete Setf Customization". - (Modify Macros, Multiple Values): Remove mentions of obsolete feature. + (Modify Macros, Multiple Values, Other Clauses): + Remove mentions of obsolete features. (Obsolete Setf Customization): Don't mention `apply' setf. 2012-10-28 Glenn Morris diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 0fc46840fae..01068d57071 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -973,6 +973,7 @@ in the sense described in Steele's book; since none of the standard Emacs place functions are suitable in this sense, this feature is only interesting when used with places you define yourself with @code{define-setf-method} or the long form of @code{defsetf}. +@xref{Obsolete Setf Customization}. @end ignore @item @@ -1208,10 +1209,9 @@ equivalent to @code{(cl-callf2 cons @var{x} @var{place})}. @end defmac The @code{cl-callf} and @code{cl-callf2} macros serve as building -blocks for other macros like @code{cl-incf}, @code{cl-pushnew}, and -@code{define-modify-macro}. The @code{letf} and @code{cl-letf*} -macros are used in the processing of symbol macros; -@pxref{Macro Bindings}. +blocks for other macros like @code{cl-incf}, and @code{cl-pushnew}. +The @code{letf} and @code{cl-letf*} macros are used in the processing +of symbol macros; @pxref{Macro Bindings}. @node Variable Bindings @@ -2438,13 +2438,12 @@ was named). The @code{return} clause is implemented a bit more efficiently, though. @end table -While there is no high-level way to add user extensions to @code{cl-loop} -(comparable to @code{defsetf} for @code{setf}, say), this package -does offer two properties called @code{cl-loop-handler} and -@code{cl-loop-for-handler} which are functions to be called when -a given symbol is encountered as a top-level loop clause or -@code{for} clause, respectively. Consult the source code in -file @file{cl-macs.el} for details. +While there is no high-level way to add user extensions to @code{cl-loop}, +this package does offer two properties called @code{cl-loop-handler} +and @code{cl-loop-for-handler} which are functions to be called when a +given symbol is encountered as a top-level loop clause or @code{for} +clause, respectively. Consult the source code in file +@file{cl-macs.el} for details. This package's @code{cl-loop} macro is compatible with that of Common Lisp, except that a few features are not implemented: @code{loop-finish} From 894b9dd938ca50ca24faf2e366631a9ab9cd79b7 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 29 Oct 2012 17:55:57 +0800 Subject: [PATCH 087/109] Manage face-remapping-alist properly in face-remap-add-relative. * face-remap.el (face-remap-add-relative): Handle the case where a face-remapping-alist entry is a cons cell. Fixes: debbugs:12762 --- lisp/ChangeLog | 5 +++++ lisp/face-remap.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 76cc7e52863..093d392d7d3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-29 Chong Yidong + + * face-remap.el (face-remap-add-relative): Handle the case where a + face-remapping-alist entry is a cons cell (Bug#12762). + 2012-10-29 Glenn Morris * emacs-lisp/cl.el (defsetf): Doc fix. diff --git a/lisp/face-remap.el b/lisp/face-remap.el index baf1eeb389d..903c12a787e 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -132,7 +132,10 @@ other than the normal definition of FACE via `face-remap-set-base'." (when (null entry) (setq entry (list face face)) ; explicitly merge with global def (push entry face-remapping-alist)) - (setcdr entry (face-remap-order (cons specs (cdr entry)))) + (let ((faces (cdr entry))) + (if (symbolp faces) + (setq faces (list faces))) + (setcdr entry (face-remap-order (cons specs faces)))) (cons face specs))) (defun face-remap-remove-relative (cookie) From 1913c5f53b1055bcd66d06d721b4bef69ca7a03f Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 29 Oct 2012 17:58:49 +0800 Subject: [PATCH 088/109] * imenu.el (imenu): Inhibit push-mark message. Fixes: debbugs:12726 --- lisp/ChangeLog | 2 ++ lisp/imenu.el | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 093d392d7d3..38a3e3806b8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-29 Chong Yidong + * imenu.el (imenu): Inhibit push-mark message (Bug#12726). + * face-remap.el (face-remap-add-relative): Handle the case where a face-remapping-alist entry is a cons cell (Bug#12762). 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." (if (stringp index-item) (setq index-item (assoc index-item (imenu--make-index-alist)))) (when index-item - (push-mark) + (push-mark nil t) (let* ((is-special-item (listp (cdr index-item))) (function (if is-special-item From e84cad57ef07b005e1b71dfb0acebac04455a4b6 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 29 Oct 2012 18:03:21 +0800 Subject: [PATCH 089/109] * thingatpt.el (thing-at-point): Doc fix. Fixes: debbugs:12691 --- lisp/ChangeLog | 2 ++ lisp/thingatpt.el | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 38a3e3806b8..4c4100a5e12 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-29 Chong Yidong + * thingatpt.el (thing-at-point): Doc fix (Bug#12691). + * imenu.el (imenu): Inhibit push-mark message (Bug#12726). * face-remap.el (face-remap-add-relative): Handle the case where a diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 57bbdf9d94a..dedd9c8c189 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -133,7 +133,7 @@ positions of the thing found." THING should be a symbol specifying a type of syntactic entity. Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', `email', `word', `sentence', `whitespace', -`line', and `page'. +`line', `number', and `page'. See the file `thingatpt.el' for documentation on how to define a symbol as a valid THING." From 5c2f2631f8c64dba6367610acbd01304049631c9 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 29 Oct 2012 18:10:15 +0800 Subject: [PATCH 090/109] Avoid a misleading message on C-h C-a. * lisp/startup.el (startup-echo-area-message): New arg. (fancy-about-screen): Avoid a misleading message. Fixes: debbugs:12680 --- lisp/ChangeLog | 3 +++ lisp/startup.el | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4c4100a5e12..46e83f0a88b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-29 Chong Yidong + * startup.el (startup-echo-area-message): New arg. + (fancy-about-screen): Avoid a misleading message (Bug#12680). + * thingatpt.el (thing-at-point): Doc fix (Bug#12691). * imenu.el (imenu): Inhibit push-mark message (Bug#12726). diff --git a/lisp/startup.el b/lisp/startup.el index 56281a6b164..6c65b30fe3c 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1693,7 +1693,7 @@ splash screen in another window." (force-mode-line-update)) (use-local-map splash-screen-keymap) (setq tab-width 22) - (message "%s" (startup-echo-area-message)) + (message "%s" (startup-echo-area-message t)) (setq buffer-read-only t) (goto-char (point-min)) (forward-line 3)))) @@ -2017,8 +2017,8 @@ Type \\[describe-distribution] for information on ")) 'follow-link t) (insert "\tBuying printed manuals from the FSF\n")) -(defun startup-echo-area-message () - (cond ((daemonp) +(defun startup-echo-area-message (&optional about-screen-message) + (cond ((and (daemonp) (not about-screen-message)) "Starting Emacs daemon.") ((eq (key-binding "\C-h\C-a") 'about-emacs) "For information about GNU Emacs and the GNU system, type C-h C-a.") From 2230fa5bbf67bfefe797d77d4ed73c5c6342209b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 29 Oct 2012 18:14:50 +0800 Subject: [PATCH 091/109] Fix last change. * lisp/startup.el (fancy-about-screen): Don't message at all. (startup-echo-area-message): Revert last change. Fixes: debbugs:12680 --- lisp/ChangeLog | 3 +-- lisp/startup.el | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 46e83f0a88b..d02da87446c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,6 @@ 2012-10-29 Chong Yidong - * startup.el (startup-echo-area-message): New arg. - (fancy-about-screen): Avoid a misleading message (Bug#12680). + * startup.el (fancy-about-screen): Don't message (Bug#12680). * thingatpt.el (thing-at-point): Doc fix (Bug#12691). diff --git a/lisp/startup.el b/lisp/startup.el index 6c65b30fe3c..2e8b6b7f8c4 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1693,7 +1693,6 @@ splash screen in another window." (force-mode-line-update)) (use-local-map splash-screen-keymap) (setq tab-width 22) - (message "%s" (startup-echo-area-message t)) (setq buffer-read-only t) (goto-char (point-min)) (forward-line 3)))) @@ -2017,8 +2016,8 @@ Type \\[describe-distribution] for information on ")) 'follow-link t) (insert "\tBuying printed manuals from the FSF\n")) -(defun startup-echo-area-message (&optional about-screen-message) - (cond ((and (daemonp) (not about-screen-message)) +(defun startup-echo-area-message () + (cond ((daemonp) "Starting Emacs daemon.") ((eq (key-binding "\C-h\C-a") 'about-emacs) "For information about GNU Emacs and the GNU system, type C-h C-a.") From 4574557789a826c88514ee3b6a661e4869836da7 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Mon, 29 Oct 2012 18:30:11 +0800 Subject: [PATCH 092/109] * woman.el (woman-parse-numeric-value): Handle picas correctly. Fixes: debbugs:12639 --- lisp/ChangeLog | 5 +++++ lisp/woman.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d02da87446c..999db57efc0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-29 Kevin Ryde + + * woman.el (woman-parse-numeric-value): Handle picas correctly + (Bug#12639). + 2012-10-29 Chong Yidong * startup.el (fancy-about-screen): Don't message (Bug#12680). 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." ((looking-at "[mnuv]")) ; ignore for now ((looking-at "i") (setq n (* n 10))) ; inch ((looking-at "c") (setq n (* n 3.9))) ; cm - ((looking-at "P") (setq n (* n 1.7))) ; Pica + ((let ((case-fold-search nil)) + (looking-at "P")) + (setq n (* n 1.7))) ; Pica ((looking-at "p") (setq n (* n 0.14))) ; point ;; NB: May be immediately followed by + or -, etc., ;; in which case do nothing and return nil. From 329c48d8b26a8943ee47682916f83f4fb60f608e Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 29 Oct 2012 18:42:58 +0800 Subject: [PATCH 093/109] * info.el (Info-complete-menu-item): Avoid duplicates. Fixes: debbugs:12705 --- lisp/ChangeLog | 12 +++++++----- lisp/info.el | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 999db57efc0..4edf3cdd03b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,10 +1,7 @@ -2012-10-29 Kevin Ryde - - * woman.el (woman-parse-numeric-value): Handle picas correctly - (Bug#12639). - 2012-10-29 Chong Yidong + * info.el (Info-complete-menu-item): Avoid duplicates (Bug#12705). + * startup.el (fancy-about-screen): Don't message (Bug#12680). * thingatpt.el (thing-at-point): Doc fix (Bug#12691). @@ -14,6 +11,11 @@ * face-remap.el (face-remap-add-relative): Handle the case where a face-remapping-alist entry is a cons cell (Bug#12762). +2012-10-29 Kevin Ryde + + * woman.el (woman-parse-numeric-value): Handle picas correctly + (Bug#12639). + 2012-10-29 Glenn Morris * emacs-lisp/cl.el (defsetf): Doc fix. 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 (while (re-search-forward pattern nil t) (push (match-string-no-properties 1) completions)) + (setq completions (delete-dups completions)) ;; Check subsequent nodes if applicable. (or (and Info-complete-next-re (setq nextnode (Info-extract-pointer "next" t)) From 1dc2755a716e15ac6b21d1f070346954d58018ef Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 29 Oct 2012 19:12:17 +0800 Subject: [PATCH 094/109] * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer. Suggested by Dan Nicolaescu. Fixes: debbugs:6326 --- lisp/ChangeLog | 3 +++ lisp/vc/vc-hooks.el | 2 ++ 2 files changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4edf3cdd03b..db12be1301f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-29 Chong Yidong + * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer. + Suggested by Dan Nicolaescu (Bug#6326). + * info.el (Info-complete-menu-item): Avoid duplicates (Bug#12705). * startup.el (fancy-about-screen): Don't message (Bug#12680). 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]': (defun vc-file-clearprops (file) "Clear all VC properties of FILE." + (if (boundp 'vc-parent-buffer) + (kill-local-variable 'vc-parent-buffer)) (setplist (intern file vc-file-prop-obarray) nil)) From e07fcbdc32093063079b21f5675e6109f143d36d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 29 Oct 2012 09:28:41 -0400 Subject: [PATCH 095/109] * lisp/files.el (find-alternate-file): Only ask one question. Fixes: debbugs:12487 --- lisp/ChangeLog | 4 ++++ lisp/files.el | 9 +++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db12be1301f..e81a6146a22 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-29 Stefan Monnier + + * files.el (find-alternate-file): Only ask one question (bug#12487). + 2012-10-29 Chong Yidong * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer. 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." t))) (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) (error "Aborted")) - (when (and (buffer-modified-p) buffer-file-name) - (if (yes-or-no-p (format "Buffer %s is modified; save it first? " - (buffer-name))) - (save-buffer) - (unless (yes-or-no-p "Kill and replace the buffer without saving it? ") - (error "Aborted")))) + (and (buffer-modified-p) buffer-file-name + (not (yes-or-no-p "Kill and replace the buffer without saving it? ")) + (error "Aborted")) (let ((obuf (current-buffer)) (ofile buffer-file-name) (onum buffer-file-number) From c606253cb5849ad04282b2f116e79963abdcea9d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 29 Oct 2012 09:50:05 -0400 Subject: [PATCH 096/109] * lisp/emacs-lisp/cl.el (letf): Add missing indent rules. Fixes: debbugs:12759 --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/cl.el | 1 + 2 files changed, 3 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e81a6146a22..387a8b0e619 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-29 Stefan Monnier + * emacs-lisp/cl.el (letf): Add missing indent rules (bug#12759). + * files.el (find-alternate-file): Only ask one question (bug#12487). 2012-10-29 Chong Yidong diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index a558e505e66..108ad037569 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -512,6 +512,7 @@ rather than relying on `lexical-binding'." (defmacro letf (bindings &rest body) "Dynamically scoped let-style bindings for places. Like `cl-letf', but with some extra backward compatibility." + (declare (indent 1) (debug cl-letf)) ;; Like cl-letf, but with special handling of symbol-function. `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function) `((cl--symbol-function ,@(cdar x)) ,@(cdr x)) From d7f9cc85284bc159166d1c600100b0080bfad494 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 29 Oct 2012 11:14:10 -0400 Subject: [PATCH 097/109] * lisp/vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk header comments". (diff-unified->context, diff-context->unified) (diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'. --- lisp/ChangeLog | 5 +++++ lisp/vc/diff-mode.el | 14 ++++++++------ test/indent/shell.sh | 5 ++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 387a8b0e619..54285a589eb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-10-29 Stefan Monnier + * vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk + header comments". + (diff-unified->context, diff-context->unified) + (diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'. + * emacs-lisp/cl.el (letf): Add missing indent rules (bug#12759). * files.el (find-alternate-file): Only ask one question (bug#12487). diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index bbe31205c0e..49b76a8e3bc 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -911,7 +911,7 @@ PREFIX is only used internally: don't use it." "Convert unified diffs to context diffs. START and END are either taken from the region (if a prefix arg is given) or else cover the whole buffer." - (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) + (interactive (if (or current-prefix-arg (use-region-p)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) (unless (markerp end) (setq end (copy-marker end t))) @@ -1035,7 +1035,7 @@ else cover the whole buffer." START and END are either taken from the region \(when it is highlighted) or else cover the whole buffer. With a prefix argument, convert unified format to context format." - (interactive (if (and transient-mark-mode mark-active) + (interactive (if (use-region-p) (list (region-beginning) (region-end) current-prefix-arg) (list (point-min) (point-max) current-prefix-arg))) (if to-context @@ -1045,7 +1045,7 @@ With a prefix argument, convert unified format to context format." (inhibit-read-only t)) (save-excursion (goto-char start) - (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) + (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)\\(?: \\(.*\\)\\|$\\)" nil t) (< (point) end)) (combine-after-change-calls (if (match-beginning 2) @@ -1061,7 +1061,9 @@ With a prefix argument, convert unified format to context format." ;; Variables to use the special undo function. (old-undo buffer-undo-list) (old-end (marker-position end)) - (reversible t)) + ;; We currently throw away the comment that can follow + ;; the hunk header. FIXME: Preserve it instead! + (reversible (not (match-end 6)))) (replace-match "") (unless (re-search-forward diff-context-mid-hunk-header-re nil t) @@ -1131,7 +1133,7 @@ With a prefix argument, convert unified format to context format." "Reverse the direction of the diffs. START and END are either taken from the region (if a prefix arg is given) or else cover the whole buffer." - (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) + (interactive (if (or current-prefix-arg (use-region-p)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) (unless (markerp end) (setq end (copy-marker end t))) @@ -1197,7 +1199,7 @@ else cover the whole buffer." "Fixup the hunk headers (in case the buffer was modified). START and END are either taken from the region (if a prefix arg is given) or else cover the whole buffer." - (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) + (interactive (if (or current-prefix-arg (use-region-p)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) (let ((inhibit-read-only t)) 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 () { case $toto in a) echo 1;; b) echo 2;; - c) echo 3;; + (c) + echo 3;; + d) + echo 3;; esac case $as_nl`(ac_space=' '; set) 2>&1` in #( From ba11600816880f862a7a85899bfa3dc41c176273 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Mon, 29 Oct 2012 09:24:29 -0800 Subject: [PATCH 098/109] 2012-10-29 Daniel Colascione cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In preparation for fixing bug#12739, move these functions from here... * coding.h, coding.c: ... to here, and compile them only when WINDOWSNT or HAVE_NTGUI. Moving these functions out of cygw32 proper lets us write cygw32-agnostic code for the HAVE_NTGUI case. --- src/ChangeLog | 10 ++++++++++ src/coding.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/coding.h | 22 ++++++++++++++++++++++ src/cygw32.c | 33 --------------------------------- src/cygw32.h | 14 -------------- 5 files changed, 74 insertions(+), 47 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index beec867d333..c76bbb5a260 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-10-29 Daniel Colascione + + * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In + preparation for fixing bug#12739, move these functions from + here... + + * coding.h, coding.c: ... to here, and compile them only when + WINDOWSNT or HAVE_NTGUI. Moving these functions out of cygw32 + proper lets us write cygw32-agnostic code for the HAVE_NTGUI case. + 2012-10-28 Eli Zaretskii * w32proc.c (TIMER_TICKS_PER_SEC): New macro. diff --git a/src/coding.c b/src/coding.c index 7628a9fbf2e..611f92ea152 100644 --- a/src/coding.c +++ b/src/coding.c @@ -343,6 +343,10 @@ Lisp_Object Qcoding_system_p, Qcoding_system_error; Lisp_Object Qemacs_mule, Qraw_text; Lisp_Object Qutf_8_emacs; +#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +static Lisp_Object Qutf_16le; +#endif + /* Coding-systems are handed between Emacs Lisp programs and C internal routines by the following three variables. */ /* Coding system to be used to encode text for terminal display when @@ -7971,6 +7975,39 @@ preferred_coding_system (void) return CODING_ID_NAME (id); } +#if defined (WINDOWSNT) || defined (HAVE_NTGUI) + +Lisp_Object +from_unicode (Lisp_Object str) +{ + CHECK_STRING (str); + if (!STRING_MULTIBYTE (str) && + SBYTES (str) & 1) + { + str = Fsubstring (str, make_number (0), make_number (-1)); + } + + return code_convert_string_norecord (str, Qutf_16le, 0); +} + +wchar_t * +to_unicode (Lisp_Object str, Lisp_Object *buf) +{ + *buf = code_convert_string_norecord (str, Qutf_16le, 1); + /* We need to make a another copy (in addition to the one made by + code_convert_string_norecord) to ensure that the final string is + _doubly_ zero terminated --- that is, that the string is + terminated by two zero bytes and one utf-16le null character. + Because strings are already terminated with a single zero byte, + we just add one additional zero. */ + str = make_uninit_string (SBYTES (*buf) + 1); + memcpy (SDATA (str), SDATA (*buf), SBYTES (*buf)); + SDATA (str) [SBYTES (*buf)] = '\0'; + *buf = str; + return WCSDATA (*buf); +} +#endif /* WINDOWSNT || HAVE_NTGUI */ + #ifdef emacs /*** 8. Emacs Lisp library functions ***/ @@ -10284,6 +10321,11 @@ syms_of_coding (void) DEFSYM (Qutf_8, "utf-8"); DEFSYM (Qutf_8_emacs, "utf-8-emacs"); +#if defined (WINDOWSNT) || defined (HAVE_NTGUI) + /* No, not utf-16-le: that one has a BOM. */ + DEFSYM (Qutf_16le, "utf-16le"); +#endif + DEFSYM (Qutf_16, "utf-16"); DEFSYM (Qbig, "big"); DEFSYM (Qlittle, "little"); diff --git a/src/coding.h b/src/coding.h index 989552bf667..6ba5f8e0e1e 100644 --- a/src/coding.h +++ b/src/coding.h @@ -701,6 +701,28 @@ extern void encode_coding_object (struct coding_system *, Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); +#if defined (WINDOWSNT) || defined (HAVE_NTGUI) + +/* These functions use Lisp string objects to store the UTF-16LE + strings that modern versions of Windows expect. These strings are + not particularly useful to Lisp, and all Lisp strings should be + native Emacs multibyte. */ + +/* Access the wide-character string stored in a Lisp string object. */ +#define WCSDATA(x) ((wchar_t *) SDATA (x)) + +/* Convert the multi-byte string in STR to UTF-16LE encoded unibyte + string, and store it in *BUF. BUF may safely point to STR on entry. */ +extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); + +/* Convert STR, a UTF-16LE encoded string embedded in a unibyte string + object, to a multi-byte Emacs string and return it. This function + calls code_convert_string_norecord internally and has all its + failure modes. STR itself is not modified. */ +extern Lisp_Object from_unicode (Lisp_Object str); + +#endif /* WINDOWSNT || HAVE_NTGUI */ + /* Macros for backward compatibility. */ #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 . */ #include "buffer.h" #include #include -static Lisp_Object Qutf_16le; static Lisp_Object fchdir_unwind (Lisp_Object dir_fd) @@ -107,36 +106,6 @@ conv_filename_from_w32_unicode (const wchar_t* in, int absolute_p) return unbind_to (count, DECODE_FILE (converted)); } -Lisp_Object -from_unicode (Lisp_Object str) -{ - CHECK_STRING (str); - if (!STRING_MULTIBYTE (str) && - SBYTES (str) & 1) - { - str = Fsubstring (str, make_number (0), make_number (-1)); - } - - return code_convert_string_norecord (str, Qutf_16le, 0); -} - -wchar_t * -to_unicode (Lisp_Object str, Lisp_Object *buf) -{ - *buf = code_convert_string_norecord (str, Qutf_16le, 1); - /* We need to make a another copy (in addition to the one made by - code_convert_string_norecord) to ensure that the final string is - _doubly_ zero terminated --- that is, that the string is - terminated by two zero bytes and one utf-16le null character. - Because strings are already terminated with a single zero byte, - we just add one additional zero. */ - str = make_uninit_string (SBYTES (*buf) + 1); - memcpy (SDATA (str), SDATA (*buf), SBYTES (*buf)); - SDATA (str) [SBYTES (*buf)] = '\0'; - *buf = str; - return WCSDATA (*buf); -} - DEFUN ("cygwin-convert-path-to-windows", Fcygwin_convert_path_to_windows, Scygwin_convert_path_to_windows, 1, 2, 0, @@ -162,8 +131,6 @@ DEFUN ("cygwin-convert-path-from-windows", void syms_of_cygw32 (void) { - /* No, not utf-16-le: that one has a BOM. */ - DEFSYM (Qutf_16le, "utf-16le"); defsubr (&Scygwin_convert_path_from_windows); defsubr (&Scygwin_convert_path_to_windows); } 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 . */ #include "lisp.h" #include "coding.h" -/* *** Character conversion *** */ - -/* Access the wide-character string stored in a Lisp string object. */ -#define WCSDATA(x) ((wchar_t *) SDATA (x)) - -/* Convert the multi-byte string in STR to UTF-16LE encoded unibyte - string, and store it in *BUF. BUF may safely point to STR on entry. */ -extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); - -/* Convert STR, a UTF-16LE encoded string embedded in a unibyte string - object, to a multi-byte Emacs string, and return it. */ -extern Lisp_Object from_unicode (Lisp_Object str); - -/* *** Misc *** */ extern void syms_of_cygw32 (void); extern char * w32_strerror (int error_no); From 748b0d840fea13e0b6ba36341873dc68e57f5bc5 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 30 Oct 2012 06:58:53 +0800 Subject: [PATCH 099/109] * thingatpt.el (number-at-point): Apply a thing-at-point property. --- lisp/ChangeLog | 4 ++++ lisp/thingatpt.el | 1 + 2 files changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 54285a589eb..2474574de92 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-29 Chong Yidong + + * thingatpt.el (number-at-point): Apply a thing-at-point property. + 2012-10-29 Stefan Monnier * vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index dedd9c8c189..50e3b785696 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -509,6 +509,7 @@ Signal an error if the entire string was not used." (defun number-at-point () "Return the number at point, or nil if none is found." (form-at-point 'sexp 'numberp)) +(put 'number 'thing-at-point 'number-at-point) ;;;###autoload (defun list-at-point () "Return the Lisp list at point, or nil if none is found." From b5dd9a779bafdbac1658b7e610ec04c195a7f21c Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 30 Oct 2012 07:20:24 +0800 Subject: [PATCH 100/109] Fix isearch handling of keypad characters with kmacros. * isearch.el (isearch-other-meta-char): Ensure that a reprocessed function key is stored in a keyboard macro. Fixes: debbugs:4894 --- lisp/ChangeLog | 3 +++ lisp/isearch.el | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2474574de92..bd57e7dc5f0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-29 Chong Yidong + * isearch.el (isearch-other-meta-char): Ensure that a reprocessed + function key is stored in a keyboard macro (Bug#4894). + * thingatpt.el (number-at-point): Apply a thing-at-point property. 2012-10-29 Stefan Monnier diff --git a/lisp/isearch.el b/lisp/isearch.el index 37993767013..ead6f88cb97 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2149,7 +2149,8 @@ Isearch mode." (setq prefix-arg arg) (apply 'isearch-unread keylist)) (setq keylist - (listify-key-sequence (lookup-key local-function-key-map key))) + (listify-key-sequence + (lookup-key local-function-key-map key))) (while keylist (setq key (car keylist)) ;; If KEY is a printing char, we handle it here @@ -2158,6 +2159,7 @@ Isearch mode." (if (and (integerp key) (>= key ?\s) (/= key 127) (< key 256)) (progn + (store-kbd-macro-event key) (isearch-process-search-char key) (setq keylist (cdr keylist))) ;; As the remaining keys in KEYLIST can't be handled From fc83c2de544c15ce8e4e8fc7c6dd68cc4956a457 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 30 Oct 2012 07:48:02 +0800 Subject: [PATCH 101/109] Document dired-do-async-shell-command changes. * dired.texi (Shell Commands in Dired): Document changes to the dired-do-async-shell-command. --- doc/emacs/ChangeLog | 5 +++++ doc/emacs/dired.texi | 11 ++++++++--- etc/NEWS | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index ef6d736db1d..ea5621e7ccf 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2012-10-29 Chong Yidong + + * dired.texi (Shell Commands in Dired): Document changes to the + dired-do-async-shell-command. + 2012-10-28 Glenn Morris * ack.texi (Acknowledgments): Mention gv.el. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 8babbcb89ea..c08dc02b04b 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -799,15 +799,20 @@ more matches. @xref{Tags Search}. @kindex ! @r{(Dired)} @kindex X @r{(Dired)} The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a -shell command string in the minibuffer and runs that shell command on +shell command string in the minibuffer, and runs that shell command on one or more files. The files that the shell command operates on are determined in the usual way for Dired commands (@pxref{Operating on Files}). The command @kbd{X} is a synonym for @kbd{!}. The command @kbd{&} (@code{dired-do-async-shell-command}) does the -same, except that it runs the shell command asynchronously. You can +same, except that it runs the shell command asynchronously. (You can also do this with @kbd{!}, by appending a @samp{&} character to the -end of the shell command. +end of the shell command.) When the command operates on more than one +file, it runs multiple parallel copies of the specified shell command, +one for each file. As an exception, if the specified shell command +ends in @samp{;} or @samp{;&}, the shell command is run in the +background on each file sequentially; Emacs waits for each invoked +shell command to terminate before running the next one. For both @kbd{!} and @kbd{&}, the working directory for the shell command is the top-level directory of the Dired buffer. diff --git a/etc/NEWS b/etc/NEWS index cfdd3355aa5..2166e1d7658 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -397,7 +397,7 @@ changes in context diffs. whitespace problems introduced by the diff. ** Dired - ++++ *** `dired-do-async-shell-command' executes each file sequentially if the command ends in `;' (when operating on multiple files). Otherwise, it executes the command on each file in parallel. From e29e39c9c6aee68a50fef5149cc3acdfa74fec72 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 30 Oct 2012 08:29:37 +0800 Subject: [PATCH 102/109] Document more Emacs 24.3 changes. * frames.texi (Visibility of Frames): Document tty-top-frame. * loading.texi (Autoload): Document autoloadp, autoload-do-load. * symbols.texi (Symbol Plists): Document function-get. --- doc/lispref/ChangeLog | 8 ++++++++ doc/lispref/frames.texi | 23 ++++++++++++++++++----- doc/lispref/loading.texi | 38 +++++++++++++++++++++++++++++++------- doc/lispref/symbols.texi | 6 ++++++ etc/NEWS | 6 +++++- 5 files changed, 68 insertions(+), 13 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 6b3febba631..2309cde2998 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,11 @@ +2012-10-30 Chong Yidong + + * symbols.texi (Symbol Plists): Document function-get. + + * loading.texi (Autoload): Document autoloadp, autoload-do-load. + + * frames.texi (Visibility of Frames): Document tty-top-frame. + 2012-10-28 Stefan Monnier * keymaps.texi (Format of Keymaps): Document the multiple diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 665b75048f3..f58d62675e5 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -1493,8 +1493,9 @@ This function returns the visibility status of frame @var{frame}. The value is @code{t} if @var{frame} is visible, @code{nil} if it is invisible, and @code{icon} if it is iconified. -On a text terminal, all frames are considered visible, whether they -are currently being displayed or not. +On a text terminal, all frames are considered ``visible'' for the +purposes of this function, even though only one frame is displayed. +@xref{Raising and Lowering}. @end defun @deffn Command iconify-frame &optional frame @@ -1550,9 +1551,21 @@ If this is non-@code{nil}, activation of the minibuffer raises the frame that the minibuffer window is in. @end defopt -You can also enable auto-raise (raising automatically when a frame is -selected) or auto-lower (lowering automatically when it is deselected) -for any frame using frame parameters. @xref{Management Parameters}. + On window systems, you can also enable auto-raising (on frame +selection) or auto-lowering (on frame deselection) using frame +parameters. @xref{Management Parameters}. + +@cindex top frame + The concept of raising and lowering frames also applies to text +terminal frames. On each text terminal, only the top frame is +displayed at any one time. + +@defun tty-top-frame terminal +This function returns the top frame on @var{terminal}. @var{terminal} +should be a terminal object, a frame (meaning that frame's terminal), +or @code{nil} (meaning the selected frame's terminal). If it does not +refer to a text terminal, the return value is @code{nil}. +@end defun @node Frame Configurations @section Frame Configurations 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} specifies the file to load to get the real definition of @var{function}. If @var{filename} does not contain either a directory name, or the -suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding -one of these suffixes, and it will not load from a file whose name is -just @var{filename} with no added suffix. (The variable +suffix @code{.el} or @code{.elc}, this function insists on adding one +of these suffixes, and it will not load from a file whose name is just +@var{filename} with no added suffix. (The variable @code{load-suffixes} specifies the exact required suffixes.) 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 symbol @var{function}. @cindex function cell in autoload -If @var{function} already has a non-void function definition that is not -an autoload object, @code{autoload} does nothing and returns @code{nil}. -If the function cell of @var{function} is void, or is already an autoload -object, then it is defined as an autoload object like this: +if @var{function} already has non-void function definition that is not +an autoload object, this function does nothing and returns @code{nil}. +Otherwise, it constructs an autoload object (@pxref{Autoload Type}), +and stores it as the function definition for @var{function}. The +autoload object has this form: @example (autoload @var{filename} @var{docstring} @var{interactive} @var{type}) @@ -468,6 +469,16 @@ refers to the documentation string in the not a macro or a keymap. @end defun +@defun autoloadp object +This function returns non-@code{nil} if @var{object} is an autoload +object. For example, to check if @code{run-prolog} is defined as an +autoloaded function, evaluate + +@smallexample +(autoloadp (symbol-function 'run-prolog)) +@end smallexample +@end defun + @cindex autoload errors The autoloaded file usually contains other definitions and may require 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 assumed to contain a trailer starting with a formfeed character. @end defvar + The following function may be used to explicitly load the library +specified by an autoload object: + +@defun autoload-do-load autoload &optional name macro-only +This function performs the loading specified by @var{autoload}, which +whould be an autoload object. The optional argument @var{name}, if +non-@code{nil}, should be a symbol whose function value is +@var{autoload}; in that case, the return value of this function is the +symbol's new function value. If the value of the optional argument +@var{macro-only} is @code{macro}, this function avoids loading a +function, only a macro. +@end defun + @node Repeated Loading @section Repeated Loading @cindex repeated loading 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. See @code{put} for an example. @end defun +@defun function-get symbol property +This function is identical to @code{get}, except that if @var{symbol} +is the name of a function alias, it looks in the property list of the +symbol naming the actual function. @xref{Defining Functions}. +@end defun + @defun put symbol property value This function puts @var{value} onto @var{symbol}'s property list under the property name @var{property}, replacing any previous property value. diff --git a/etc/NEWS b/etc/NEWS index 2166e1d7658..a6d6b1c5eeb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -898,12 +898,15 @@ result in a warning ("Eager macro-expansion skipped due to cycle") describing the cycle. ** Miscellaneous new functions: - ++++ *** `autoloadp' ++++ *** `autoload-do-load' +++ *** `buffer-narrowed-p' tests if the buffer is narrowed. ++++ *** `file-name-base' returns a file name sans directory and extension. ++++ *** `function-get' fetches a function property, following aliases. +++ *** `posnp' tests if an object is a `posn'. @@ -912,6 +915,7 @@ describing the cycle. *** `system-users' returns the user names on the system. +++ *** `system-groups' returns the group names on the system. ++++ *** `tty-top-frame' returns the topmost frame of a text terminal. ** New macros `setq-local' and `defvar-local'. From 7f590b0c3b25602499432bf986e7b593fc158c0b Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Mon, 29 Oct 2012 17:56:38 -0800 Subject: [PATCH 103/109] Fix build break in non-Cygw32 Cygwin builds introduced in 2012-10-29T17:24:29Z!dancol@dancol.org. --- src/coding.c | 7 ++++--- src/coding.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/coding.c b/src/coding.c index 611f92ea152..97268e0dcd8 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7975,7 +7975,7 @@ preferred_coding_system (void) return CODING_ID_NAME (id); } -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined (WINDOWSNT) || defined (CYGWIN) Lisp_Object from_unicode (Lisp_Object str) @@ -8006,7 +8006,8 @@ to_unicode (Lisp_Object str, Lisp_Object *buf) *buf = str; return WCSDATA (*buf); } -#endif /* WINDOWSNT || HAVE_NTGUI */ + +#endif /* WINDOWSNT || CYGWIN */ #ifdef emacs @@ -10321,7 +10322,7 @@ syms_of_coding (void) DEFSYM (Qutf_8, "utf-8"); DEFSYM (Qutf_8_emacs, "utf-8-emacs"); -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined (WINDOWSNT) || defined (CYGWIN) /* No, not utf-16-le: that one has a BOM. */ DEFSYM (Qutf_16le, "utf-16le"); #endif diff --git a/src/coding.h b/src/coding.h index 6ba5f8e0e1e..192be58f083 100644 --- a/src/coding.h +++ b/src/coding.h @@ -701,7 +701,7 @@ extern void encode_coding_object (struct coding_system *, Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined (WINDOWSNT) || defined (CYGWIN) /* These functions use Lisp string objects to store the UTF-16LE strings that modern versions of Windows expect. These strings are @@ -721,7 +721,7 @@ extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); failure modes. STR itself is not modified. */ extern Lisp_Object from_unicode (Lisp_Object str); -#endif /* WINDOWSNT || HAVE_NTGUI */ +#endif /* WINDOWSNT || CYGWIN */ /* Macros for backward compatibility. */ From 53372c278e7e79b97aed97b159a00bde45de3a80 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Mon, 29 Oct 2012 19:10:52 -0800 Subject: [PATCH 104/109] Complete fix for build break --- src/ChangeLog | 4 ++-- src/coding.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c76bbb5a260..831af6c58a2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,8 +5,8 @@ here... * coding.h, coding.c: ... to here, and compile them only when - WINDOWSNT or HAVE_NTGUI. Moving these functions out of cygw32 - proper lets us write cygw32-agnostic code for the HAVE_NTGUI case. + WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper + lets us write cygw32-agnostic code for the HAVE_NTGUI case. 2012-10-28 Eli Zaretskii diff --git a/src/coding.c b/src/coding.c index 97268e0dcd8..56202e4861d 100644 --- a/src/coding.c +++ b/src/coding.c @@ -343,7 +343,7 @@ Lisp_Object Qcoding_system_p, Qcoding_system_error; Lisp_Object Qemacs_mule, Qraw_text; Lisp_Object Qutf_8_emacs; -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined (WINDOWSNT) || defined (CYGWIN) static Lisp_Object Qutf_16le; #endif From ce69a8443a7adc386235cb1b5eba3189dfe89d4e Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 30 Oct 2012 14:23:31 +0800 Subject: [PATCH 105/109] Add a comment for the last isearch.el change. --- lisp/isearch.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/isearch.el b/lisp/isearch.el index ead6f88cb97..0bfda880d93 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2159,6 +2159,8 @@ Isearch mode." (if (and (integerp key) (>= key ?\s) (/= key 127) (< key 256)) (progn + ;; Ensure that the processed char is recorded in + ;; the keyboard macro, if any (Bug#4894) (store-kbd-macro-event key) (isearch-process-search-char key) (setq keylist (cdr keylist))) From 4ddedf94c8529de0c13b74c1156d89872f94c155 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 30 Oct 2012 00:34:37 -0700 Subject: [PATCH 106/109] Doc and manual updates for cl-letf and letf Fixes: debbugs:12760 * doc/misc/cl.texi (Modify Macros): Update for cl-letf changes. (Obsolete Lexical Macros): Say a little more about letf/cl-letf. * lisp/emacs-lisp/cl.el (letf): Doc fix. * etc/NEWS: Related edit. --- doc/misc/ChangeLog | 5 ++++ doc/misc/cl.texi | 59 +++++++++++++++++++++++++++---------------- etc/NEWS | 3 +++ lisp/ChangeLog | 4 +++ lisp/emacs-lisp/cl.el | 4 ++- 5 files changed, 52 insertions(+), 23 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 92b5b243ec9..b07db9d605f 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,8 @@ +2012-10-30 Glenn Morris + + * cl.texi (Modify Macros): Update for cl-letf changes. + (Obsolete Lexical Macros): Say a little more about letf/cl-letf. + 2012-10-29 Glenn Morris * cl.texi (Organization): More details on cl-lib.el versus cl.el. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 01068d57071..f520144679e 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -882,7 +882,7 @@ generalized variables. @menu * Setf Extensions:: Additional @code{setf} places. -* Modify Macros:: @code{cl-incf}, @code{cl-rotatef}, @code{letf}, @code{cl-callf}, etc. +* Modify Macros:: @code{cl-incf}, @code{cl-rotatef}, @code{cl-letf}, @code{cl-callf}, etc. @end menu @node Setf Extensions @@ -1127,7 +1127,7 @@ conveniently exchanges @var{a} and @var{b}. The following macros were invented for this package; they have no analogues in Common Lisp. -@defmac letf (bindings@dots{}) forms@dots{} +@defmac cl-letf (bindings@dots{}) forms@dots{} This macro is analogous to @code{let}, but for generalized variables rather than just symbols. Each @var{binding} should be of the form @code{(@var{place} @var{value})}; the original contents of the @@ -1140,47 +1140,59 @@ error. For example, @example -(letf (((point) (point-min)) - (a 17)) - ...) +(cl-letf (((point) (point-min)) + (a 17)) + ...) @end example @noindent -moves ``point'' in the current buffer to the beginning of the buffer, +moves point in the current buffer to the beginning of the buffer, and also binds @code{a} to 17 (as if by a normal @code{let}, since @code{a} is just a regular variable). After the body exits, @code{a} is set back to its original value and point is moved back to its original position. -Note that @code{letf} on @code{(point)} is not quite like a +Note that @code{cl-letf} on @code{(point)} is not quite like a @code{save-excursion}, as the latter effectively saves a marker which tracks insertions and deletions in the buffer. Actually, -a @code{letf} of @code{(point-marker)} is much closer to this +a @code{cl-letf} of @code{(point-marker)} is much closer to this behavior. (@code{point} and @code{point-marker} are equivalent as @code{setf} places; each will accept either an integer or a marker as the stored value.) Since generalized variables look like lists, @code{let}'s shorthand of using @samp{foo} for @samp{(foo nil)} as a @var{binding} would -be ambiguous in @code{letf} and is not allowed. +be ambiguous in @code{cl-letf} and is not allowed. However, a @var{binding} specifier may be a one-element list @samp{(@var{place})}, which is similar to @samp{(@var{place} @var{place})}. In other words, the @var{place} is not disturbed -on entry to the body, and the only effect of the @code{letf} is -to restore the original value of @var{place} afterwards. (The -redundant access-and-store suggested by the @code{(@var{place} +on entry to the body, and the only effect of the @code{cl-letf} is +to restore the original value of @var{place} afterwards. +@c I suspect this may no longer be true; either way it's +@c implementation detail and so not essential to document. +@ignore +(The redundant access-and-store suggested by the @code{(@var{place} @var{place})} example does not actually occur.) +@end ignore -In most cases, the @var{place} must have a well-defined value on -entry to the @code{letf} form. The only exceptions are plain -variables and calls to @code{symbol-value} and @code{symbol-function}. -If the symbol is not bound on entry, it is simply made unbound by -@code{makunbound} or @code{fmakunbound} on exit. +Note that in this case, and in fact almost every case, @var{place} +must have a well-defined value outside the @code{cl-letf} body. +There is essentially only one exception to this, which is @var{place} +a plain variable with a specified @var{value} (such as @code{(a 17)} +in the above example). +@c See http://debbugs.gnu.org/12758 +@c Some or all of this was true for cl.el, but not for cl-lib.el. +@ignore +The only exceptions are plain variables and calls to +@code{symbol-value} and @code{symbol-function}. If the symbol is not +bound on entry, it is simply made unbound by @code{makunbound} or +@code{fmakunbound} on exit. +@end ignore @end defmac @defmac cl-letf* (bindings@dots{}) forms@dots{} -This macro is to @code{letf} what @code{let*} is to @code{let}: +This macro is to @code{cl-letf} what @code{let*} is to @code{let}: It does the bindings in sequential rather than parallel order. @end defmac @@ -1210,7 +1222,7 @@ equivalent to @code{(cl-callf2 cons @var{x} @var{place})}. The @code{cl-callf} and @code{cl-callf2} macros serve as building blocks for other macros like @code{cl-incf}, and @code{cl-pushnew}. -The @code{letf} and @code{cl-letf*} macros are used in the processing +The @code{cl-letf} and @code{cl-letf*} macros are used in the processing of symbol macros; @pxref{Macro Bindings}. @@ -1221,7 +1233,7 @@ of symbol macros; @pxref{Macro Bindings}. These Lisp forms make bindings to variables and function names, analogous to Lisp's built-in @code{let} form. -@xref{Modify Macros}, for the @code{letf} and @code{cl-letf*} forms which +@xref{Modify Macros}, for the @code{cl-letf} and @code{cl-letf*} forms which are also related to variable bindings. @menu @@ -1370,7 +1382,7 @@ I.e., @code{(setq foo 4)} in the above would be equivalent to @code{(setf foo 4)}, which in turn expands to @code{(setf (car bar) 4)}. Likewise, a @code{let} or @code{let*} binding a symbol macro is -treated like a @code{letf} or @code{cl-letf*}. This differs from true +treated like a @code{cl-letf} or @code{cl-letf*}. This differs from true @c FIXME does it work like this in Emacs with lexical-binding = t? Common Lisp, where the rules of lexical scoping cause a @code{let} binding to shadow a @code{cl-symbol-macrolet} binding. In this package, @@ -4870,7 +4882,10 @@ Replaced by @code{cl-labels} (@pxref{Function Bindings}). @end defmac @defmac letf (bindings@dots{}) forms@dots{} -Replaced by @code{cl-letf} (@pxref{Modify Macros}). +This macro is almost exactly the same as @code{cl-letf}, which +replaces it (@pxref{Modify Macros}). The only difference is in +details that relate to some deprecated usage of @code{symbol-function} +in place forms. @end defmac @node Obsolete Setf Customization diff --git a/etc/NEWS b/etc/NEWS index a6d6b1c5eeb..7e8684258a6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -323,7 +323,10 @@ The difference is that it relies on the `lexical-binding' machinery (as opposed to the `lexical-let' machinery used previously) to capture definitions in closures, so such closures will only work if `lexical-binding' is in use. ++++ *** `cl-letf' is not exactly like `letf'. +The only difference is in details that relate to some deprecated usage +of `symbol-function' in place forms. +++ *** `progv' was rewritten to use the `let' machinery. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bd57e7dc5f0..c5c3b93d195 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-30 Glenn Morris + + * emacs-lisp/cl.el (letf): Doc fix. (Bug#12760) + 2012-10-29 Chong Yidong * isearch.el (isearch-other-meta-char): Ensure that a reprocessed diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 108ad037569..d3ef83961e2 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -511,7 +511,9 @@ rather than relying on `lexical-binding'." (defmacro letf (bindings &rest body) "Dynamically scoped let-style bindings for places. -Like `cl-letf', but with some extra backward compatibility." +For more details, see `cl-letf'. This macro behaves like that one +in almost every respect (apart from details that relate to some +deprecated usage of `symbol-function' in place forms)." ; bug#12760 (declare (indent 1) (debug cl-letf)) ;; Like cl-letf, but with special handling of symbol-function. `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function) From 516e1a08ce36fca220a0eaead731d3fe2d3bb271 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 30 Oct 2012 00:54:17 -0700 Subject: [PATCH 107/109] More small manual updates for cl.texi * doc/misc/cl.texi (Setf Extensions): Partially restore note about cl-getf, mainly moved to lispref/variables.texi. (Property Lists): Fix cl-getf typos. * doc/lispref/variables.texi (Generalized Variables): Fix typo. --- doc/lispref/ChangeLog | 4 ++++ doc/lispref/variables.texi | 8 ++++---- doc/misc/ChangeLog | 3 +++ doc/misc/cl.texi | 13 ++++++++----- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 2309cde2998..eca39e54203 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2012-10-30 Glenn Morris + + * variables.texi (Generalized Variables): Fix typo. + 2012-10-30 Chong Yidong * symbols.texi (Symbol Plists): Document function-get. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 1ffb1f7ffcb..580dd8258df 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2025,10 +2025,10 @@ process-filter Using any forms other than these in the @var{place} argument to @code{setf} will signal an error. -Note that for @code{nthcdr} and @code{getf}, the list argument -of the function must itself be a valid @var{place} form. For -example, @code{(setf (nthcdr 0 foo) 7)} will set @code{foo} itself -to 7. +@c And for cl-lib's cl-getf. +Note that for @code{nthcdr}, the list argument of the function must +itself be a valid @var{place} form. For example, @code{(setf (nthcdr +0 foo) 7)} will set @code{foo} itself to 7. @c The use of @code{nthcdr} as a @var{place} form is an extension @c to standard Common Lisp. diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index b07db9d605f..fa58cd958db 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -2,6 +2,9 @@ * cl.texi (Modify Macros): Update for cl-letf changes. (Obsolete Lexical Macros): Say a little more about letf/cl-letf. + (Setf Extensions): Partially restore note about cl-getf, + mainly moved to lispref/variables.texi. + (Property Lists): Fix cl-getf typos. 2012-10-29 Glenn Morris diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index f520144679e..4105ac349ec 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -900,6 +900,10 @@ cl-caaar .. cl-cddddr cl-first .. cl-tenth cl-rest cl-get cl-getf cl-subseq @end smallexample +@noindent +Note that for @code{cl-getf} (as for @code{nthcdr}), the list argument +of the function must itself be a valid @var{place} form. + @item General Emacs Lisp functions: @smallexample @@ -2813,10 +2817,10 @@ is given). In particular, @example -(get sym prop) @equiv{} (cl-get (symbol-plist sym) prop) +(get sym prop) @equiv{} (cl-getf (symbol-plist sym) prop) @end example -It is valid to use @code{getf} as a @code{setf} place, in which case +It is valid to use @code{cl-getf} as a @code{setf} place, in which case its @var{place} argument must itself be a valid @code{setf} place. The @var{default} argument, if any, is ignored in this context. The effect is to change (via @code{setcar}) the value cell in the @@ -2824,7 +2828,7 @@ list that corresponds to @var{property}, or to cons a new property-value pair onto the list if the property is not yet present. @example -(put sym prop val) @equiv{} (setf (cl-get (symbol-plist sym) prop) val) +(put sym prop val) @equiv{} (setf (cl-getf (symbol-plist sym) prop) val) @end example The @code{get} and @code{cl-get} functions are also @code{setf}-able. @@ -2837,8 +2841,7 @@ The fact that @code{default} is ignored can sometimes be useful: Here, symbol @code{foo}'s @code{usage-count} property is incremented if it exists, or set to 1 (an incremented 0) otherwise. -@c FIXME cl-getf? -When not used as a @code{setf} form, @code{getf} is just a regular +When not used as a @code{setf} form, @code{cl-getf} is just a regular function and its @var{place} argument can actually be any Lisp expression. @end defun From f43a5263c18258ab05d057881fa6b8795e65295a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 30 Oct 2012 01:03:22 -0700 Subject: [PATCH 108/109] cl-mapc small fixes * lisp/emacs-lisp/cl-extra.el (cl-mapc): Add autoload cookie. Doc fix. * doc/misc/cl.texi (Mapping over Sequences): Mention cl-mapc naming oddity. --- doc/misc/ChangeLog | 1 + doc/misc/cl.texi | 8 ++++++-- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/cl-extra.el | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index fa58cd958db..941c430ce74 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -5,6 +5,7 @@ (Setf Extensions): Partially restore note about cl-getf, mainly moved to lispref/variables.texi. (Property Lists): Fix cl-getf typos. + (Mapping over Sequences): Mention cl-mapc naming oddity. 2012-10-29 Glenn Morris diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 4105ac349ec..8cee1cf9639 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -199,6 +199,8 @@ because they are replaced by other standard Emacs Lisp features. Finally, in a very few cases the old @file{cl.el} versions do not behave in exactly the same way as the @file{cl-lib.el} versions. @xref{Obsolete Features}. +@c There is also cl-mapc, which was called cl-mapc even before cl-lib.el. +@c But not autoloaded, so maybe not much used? Since the old @file{cl.el} does not use a clean namespace, Emacs has a policy that packages distributed with Emacs must not load @code{cl} at @@ -3309,13 +3311,15 @@ that it passes in the list pointers themselves rather than the @code{car}s of the advancing pointers. @end defun -@c FIXME does not exist? @defun cl-mapc function seq &rest more-seqs This function is like @code{cl-mapcar}, except that the values returned by @var{function} are ignored and thrown away rather than being collected into a list. The return value of @code{cl-mapc} is @var{seq}, the first sequence. This function is more general than the Emacs -primitive @code{mapc}. +primitive @code{mapc}. (Note that this function is called +@code{cl-mapc} even in @file{cl.el}, rather than @code{map*} as you +might expect.) +@c http://debbugs.gnu.org/6575 @end defun @defun cl-mapl function list &rest more-lists diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c5c3b93d195..bd535894cdf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-30 Glenn Morris + * emacs-lisp/cl-extra.el (cl-mapc): Add autoload cookie. Doc fix. + * emacs-lisp/cl.el (letf): Doc fix. (Bug#12760) 2012-10-29 Chong Yidong 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. (setq cl-list (cdr cl-list))) (nreverse cl-res)))) +;;;###autoload (defun cl-mapc (cl-func cl-seq &rest cl-rest) - "Like `mapcar', but does not accumulate values returned by the function. + "Like `cl-mapcar', but does not accumulate values returned by the function. \n(fn FUNCTION SEQUENCE...)" (if cl-rest (progn (apply 'cl-map nil cl-func cl-seq cl-rest) From fcc1acdadbeae00d8dcabeb6dccb20da9672af2c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 30 Oct 2012 06:18:56 -0400 Subject: [PATCH 109/109] Auto-commit of loaddefs files. --- lisp/emacs-lisp/cl-loaddefs.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 684ea42b157..5ad6e37a5a1 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -10,8 +10,8 @@ ;;;;;; cl-truncate cl-ceiling cl-floor cl-isqrt cl-lcm cl-gcd cl--set-frame-visible-p ;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively ;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan -;;;;;; cl-mapl cl-maplist cl-map cl--mapcar-many cl-equalp cl-coerce) -;;;;;; "cl-extra" "cl-extra.el" "1572ae52fa4fbd9c4bf89b49a068a865") +;;;;;; cl-mapl cl-mapc cl-maplist cl-map cl--mapcar-many cl-equalp +;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "7d7f65d8a05e954a919fe2555b68fb05") ;;; Generated autoloads from cl-extra.el (autoload 'cl-coerce "cl-extra" "\ @@ -46,6 +46,11 @@ the elements themselves. \(fn FUNCTION LIST...)" nil nil) +(autoload 'cl-mapc "cl-extra" "\ +Like `cl-mapcar', but does not accumulate values returned by the function. + +\(fn FUNCTION SEQUENCE...)" nil nil) + (autoload 'cl-mapl "cl-extra" "\ Like `cl-maplist', but does not accumulate values returned by the function.