Now on revision 111470. 1 tag(s) updated. ------------------------------------------------------------ revno: 111470 committer: Michael Albinus + + * tramp.texi (Default Host): Introduce `tramp-default-host-alist'. + 2013-01-09 Bastien Guerry * org.texi (Pushing to MobileOrg): Add footnote about using === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2013-01-05 21:18:01 +0000 +++ doc/misc/tramp.texi 2013-01-10 07:34:48 +0000 @@ -1279,8 +1279,8 @@ @end lisp @noindent -See the documentation for the variable -@code{tramp-default-user-alist} for more details. +See the documentation for the variable @code{tramp-default-user-alist} +for more details. One trap to fall in must be known. If @value{tramp} finds a default user, this user will be passed always to the connection command as @@ -1338,6 +1338,18 @@ because @samp{/:} is the prefix for quoted file names. @end ifset +@vindex tramp-default-host-alist +Like with methods and users, you can also specify different default +hosts for certain method/user combinations via the variable +@code{tramp-default-host-alist}. Usually, this isn't necessary, +because @code{tramp-default-host} should be sufficient. For some +methods, like @code{adb}, that default value must be overwritten, +which is already the initial value of @code{tramp-default-host-alist}. + +@noindent +See the documentation for the variable @code{tramp-default-host-alist} +for more details. + @node Multi-hops @section Connecting to a remote host using multiple hops ------------------------------------------------------------ revno: 111469 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-01-10 00:05:24 -0500 message: * lisp/doc-view.el (doc-view-pdfdraw-program): Allow "pdfdraw" name. (doc-view-pdf->png-converter-function): Use mupdf if available. (doc-view-djvu->png-converter-function) (doc-view-ps->png-converter-function): Remove. (doc-view--image-file-pattern): Replace doc-view--image-file-extension. (doc-view-goto-page, doc-view-convert-current-doc, doc-view-display) (doc-view-already-converted-p): Adjust accordingly. (doc-view-mode-p): Simplify. (doc-view-enlarge): Use setq-local. (doc-view-pdf->png-converter-ghostscript) (doc-view-djvu->png-converter-ddjvu) (doc-view-pdf->png-converter-mupdf): Rework to call doc-view-start-process directly. (doc-view-pdf/ps->png): Simplify accordingly. (doc-view-pdf->png-1, doc-view-djvu->png-1): Remove. (doc-view-document->bitmap): Rename from doc-view-document->png. (doc-view-convert-current-doc): Merge pdf and djvu cases. (doc-view-set-slice-from-bounding-box): Fix completion table. (doc-view-mode): Use add-hook for after-revert-hook. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-10 03:43:02 +0000 +++ lisp/ChangeLog 2013-01-10 05:05:24 +0000 @@ -1,3 +1,25 @@ +2013-01-10 Stefan Monnier + + * doc-view.el (doc-view-pdfdraw-program): Allow "pdfdraw" name. + (doc-view-pdf->png-converter-function): Use mupdf if available. + (doc-view-djvu->png-converter-function) + (doc-view-ps->png-converter-function): Remove. + (doc-view--image-file-pattern): Replace doc-view--image-file-extension. + (doc-view-goto-page, doc-view-convert-current-doc, doc-view-display) + (doc-view-already-converted-p): Adjust accordingly. + (doc-view-mode-p): Simplify. + (doc-view-enlarge): Use setq-local. + (doc-view-pdf->png-converter-ghostscript) + (doc-view-djvu->png-converter-ddjvu) + (doc-view-pdf->png-converter-mupdf): Rework to call + doc-view-start-process directly. + (doc-view-pdf/ps->png): Simplify accordingly. + (doc-view-pdf->png-1, doc-view-djvu->png-1): Remove. + (doc-view-document->bitmap): Rename from doc-view-document->png. + (doc-view-convert-current-doc): Merge pdf and djvu cases. + (doc-view-set-slice-from-bounding-box): Fix completion table. + (doc-view-mode): Use add-hook for after-revert-hook. + 2013-01-10 Glenn Morris * emacs-lisp/authors.el (authors-ignored-files) === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2013-01-09 21:24:42 +0000 +++ lisp/doc-view.el 2013-01-10 05:05:24 +0000 @@ -158,13 +158,18 @@ :type 'file :group 'doc-view) -(defcustom doc-view-pdfdraw-program "mudraw" - "Program to convert PDF files to PNG." +(defcustom doc-view-pdfdraw-program + (cond + ((executable-find "pdfdraw") "pdfdraw") + (t "mudraw")) + "Name of MuPDF's program to convert PDF files to PNG." :type 'file :version "24.4") (defcustom doc-view-pdf->png-converter-function - 'doc-view-pdf->png-converter-ghostscript + (if (executable-find doc-view-pdfdraw-program) + #'doc-view-pdf->png-converter-mupdf + #'doc-view-pdf->png-converter-ghostscript) "Function to call to convert a PDF file into a PNG file." :type '(radio (function-item doc-view-pdf->png-converter-ghostscript @@ -174,23 +179,6 @@ function) :version "24.4") -;; FIXME: Get rid of it: there's no choice. -(defcustom doc-view-djvu->png-converter-function - 'doc-view-djvu->png-converter-ddjvu - "Function to call to convert a DJVU file into a PNG file" - :type '(radio (function-item doc-view-djvu->png-converter-ddjvu - :doc "Use ddjvu") - function)) - -;; FIXME: Get rid of it: there's no choice. -(defcustom doc-view-ps->png-converter-function - 'doc-view-ps->png-converter-ghostscript - "Function to call to convert a PS file into a PNG file." - :type '(radio (function-item doc-view-ps->png-converter-ghostscript - :doc "Use ghostscript") - function) - :version "24.4") - (defcustom doc-view-ghostscript-options '("-dSAFER" ;; Avoid security problems when rendering files from untrusted ;; sources. @@ -358,14 +346,13 @@ May operate on the source document or on some intermediate (typically PDF) conversion of it.") -(defvar doc-view--image-type nil +(defvar-local doc-view--image-type nil "The type of image in the current buffer. Can be `png' or `tiff'.") -(defvar doc-view--image-file-extension nil - ;; FIXME: Replace it with a `format' string, like "page-%d.png". - "The file extension of the image type in the current buffer. -Can be `png' or `tif'.") +(defvar-local doc-view--image-file-pattern nil + "The `format' pattern of image file names. +Typically \"page-%s.png\".") ;;;; DocView Keymaps @@ -506,7 +493,7 @@ ;; that's not right if the pages are not generated sequentially ;; or if the page isn't in doc-view-current-files yet. (let ((file (expand-file-name - (format "page-%d.%s" page doc-view--image-file-extension) + (format doc-view--image-file-pattern page) (doc-view-current-cache-dir)))) (doc-view-insert-image file :pointer 'arrow) (set-window-hscroll (selected-window) hscroll) @@ -708,8 +695,7 @@ (executable-find doc-view-dvipdf-program)) (and doc-view-dvipdfm-program (executable-find doc-view-dvipdfm-program))))) - ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps) - (eq type 'pdf)) + ((memq type '(postscript ps eps pdf)) ;; FIXME: allow mupdf here (and doc-view-ghostscript-program (executable-find doc-view-ghostscript-program))) @@ -735,13 +721,13 @@ ;; ImageMagick supports on-the-fly-rescaling. (let ((new (ceiling (* factor doc-view-image-width)))) (unless (equal new doc-view-image-width) - (set (make-local-variable 'doc-view-image-width) new) + (setq-local doc-view-image-width new) (doc-view-insert-image (plist-get (cdr (doc-view-current-image)) :file) :width doc-view-image-width))) (let ((new (ceiling (* factor doc-view-resolution)))) (unless (equal new doc-view-resolution) - (set (make-local-variable 'doc-view-resolution) new) + (setq-local doc-view-resolution new) (doc-view-reconvert-doc))))) (defun doc-view-shrink (factor) @@ -878,35 +864,44 @@ (list "-o" pdf dvi) callback))) -(defun doc-view-pdf->png-converter-ghostscript (resolution pdf png &optional page) - `((command . ,doc-view-ghostscript-program) - (arguments . (,@doc-view-ghostscript-options - ,(format "-r%d" resolution) - ,@(if page `(,(format "-dFirstPage=%d" page))) - ,@(if page `(,(format "-dLastPage=%d" page))) - ,(concat "-sOutputFile=" png) - ,pdf)))) +(defun doc-view-pdf->png-converter-ghostscript (pdf png page callback) + (doc-view-start-process + "pdf/ps->png" doc-view-ghostscript-program + `(,@doc-view-ghostscript-options + ,(format "-r%d" (round doc-view-resolution)) + ,@(if page `(,(format "-dFirstPage=%d" page))) + ,@(if page `(,(format "-dLastPage=%d" page))) + ,(concat "-sOutputFile=" png) + ,pdf) + callback)) (defalias 'doc-view-ps->png-converter-ghostscript 'doc-view-pdf->png-converter-ghostscript) -(defun doc-view-djvu->png-converter-ddjvu (resolution djvu png &optional page) - `((command . "ddjvu") - (arguments . ("-format=tiff" - ;; ddjvu only accepts the range 1-999. - ,(format "-scale=%d" resolution) - ;; -eachpage was only added after djvulibre-3.5.25.3! - ,@(unless page '("-eachpage")) - ,@(if page `(,(format "-page=%d" page))) - ,djvu - ,png)))) +(defun doc-view-djvu->tiff-converter-ddjvu (djvu tiff page callback) + "Convert PAGE of a DJVU file to bitmap(s) asynchronously. +Call CALLBACK with no arguments when done. +If PAGE is nil, convert the whole document." + (doc-view-start-process + "djvu->tiff" "ddjvu" + `("-format=tiff" + ;; ddjvu only accepts the range 1-999. + ,(format "-scale=%d" (round doc-view-resolution)) + ;; -eachpage was only added after djvulibre-3.5.25.3! + ,@(unless page '("-eachpage")) + ,@(if page `(,(format "-page=%d" page))) + ,djvu + ,tiff) + callback)) -(defun doc-view-pdf->png-converter-mupdf (resolution pdf png &optional page) - `((command . ,doc-view-pdfdraw-program) - (arguments . (,(concat "-o" png) - ,(format "-r%d" resolution) - ,pdf - ,@(if page `(,(format "%d" page))))))) +(defun doc-view-pdf->png-converter-mupdf (pdf png page callback) + (doc-view-start-process + "pdf->png" doc-view-pdfdraw-program + `(,(concat "-o" png) + ,(format "-r%d" (round doc-view-resolution)) + ,pdf + ,@(if page `(,(format "%d" page)))) + callback)) (defun doc-view-odf->pdf (odf callback) "Convert ODF to PDF asynchronously and call CALLBACK when finished. @@ -919,16 +914,12 @@ (defun doc-view-pdf/ps->png (pdf-ps png) ;; FIXME: Fix name and docstring to account for djvu&tiff. "Convert PDF-PS to PNG asynchronously." - (let ((invocation - (funcall (pcase doc-view-doc-type - (`pdf doc-view-pdf->png-converter-function) - (`djvu doc-view-djvu->png-converter-function) - (_ doc-view-ps->png-converter-function)) - (round doc-view-resolution) pdf-ps png))) - - (doc-view-start-process - "pdf/ps->png" (cdr (assoc 'command invocation)) - (cdr (assoc 'arguments invocation)) + (funcall + (pcase doc-view-doc-type + (`pdf doc-view-pdf->png-converter-function) + (`djvu #'doc-view-djvu->tiff-converter-ddjvu) + (_ #'doc-view-ps->png-converter-ghostscript)) + pdf-ps png nil (let ((resolution doc-view-resolution)) (lambda () ;; Only create the resolution file when it's all done, so it also @@ -940,7 +931,8 @@ (when doc-view-current-timer (cancel-timer doc-view-current-timer) (setq doc-view-current-timer nil)) - (doc-view-display (current-buffer) 'force))))) + (doc-view-display (current-buffer) 'force)))) + ;; Update the displayed pages as soon as they're done generating. (when doc-view-conversion-refresh-interval (setq doc-view-current-timer @@ -948,31 +940,10 @@ 'doc-view-display (current-buffer))))) -(defun doc-view-pdf->png-1 (pdf png page callback) - "Convert a PAGE of a PDF file to PNG asynchronously. -Call CALLBACK with no arguments when done." - (let ((invocation (funcall doc-view-pdf->png-converter-function - (round doc-view-resolution) pdf png page))) - (doc-view-start-process - "pdf/ps->png" (cdr (assoc 'command invocation)) - (cdr (assoc 'arguments invocation)) - callback))) - -(defun doc-view-djvu->png-1 (djvu png page callback) - "Convert a PAGE of a DJVU file to bitmap asynchronously. -Call CALLBACK with no arguments when done." - (let ((invocation (funcall doc-view-djvu->png-converter-function - (round doc-view-resolution) djvu png page))) - (doc-view-start-process - "djvu->png" (cdr (assoc 'command invocation)) - (cdr (assoc 'arguments invocation)) - callback))) - (declare-function clear-image-cache "image.c" (&optional filter)) -(defun doc-view-document->png (pdf png pages single-page-converter) - ;; FIXME: Fix docstring. - "Convert a PDF file to PNG asynchronously. +(defun doc-view-document->bitmap (pdf png pages single-page-converter) + "Convert a document file to bitmap images asynchronously. Start by converting PAGES, and then the rest." (if (null pages) (doc-view-pdf/ps->png pdf png) @@ -985,7 +956,7 @@ pdf (format png (car pages)) (car pages) (lambda () (if rest - (doc-view-document->png pdf png rest) + (doc-view-document->bitmap pdf png rest) ;; Yippie, the important pages are done, update the display. (clear-image-cache) ;; For the windows that have a message (like "Welcome to @@ -1065,7 +1036,7 @@ ;; resets during the redisplay). (setq doc-view-pending-cache-flush t) (let ((png-file (expand-file-name - (concat "page-%d." doc-view--image-file-extension) + (format doc-view--image-file-pattern "%d") (doc-view-current-cache-dir)))) (make-directory (doc-view-current-cache-dir) t) (pcase doc-view-doc-type @@ -1092,15 +1063,11 @@ ;; Rename to doc.pdf (rename-file opdf pdf) (doc-view-pdf/ps->png pdf png-file))))) - (`pdf - (let ((pages (doc-view-active-pages))) - ;; Convert PDF to PNG images starting with the active pages. - (doc-view-document->png doc-view-buffer-file-name png-file pages - 'doc-view-pdf->png-1))) - (`djvu - (let ((pages (doc-view-active-pages))) - (doc-view-document->png doc-view-buffer-file-name png-file pages - 'doc-view-djvu->png-1))) + ((or `pdf `djvu) + (let ((pages (doc-view-active-pages))) + ;; Convert doc to bitmap images starting with the active pages. + (doc-view-document->bitmap doc-view-buffer-file-name png-file pages + doc-view-single-page-converter-function))) (_ ;; Convert to PNG images. (doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) @@ -1211,9 +1178,10 @@ (let* ((is (image-size (doc-view-current-image) t)) (iw (car is)) (ih (cdr is)) - (ps (or (and (null force-paper-size) (doc-view-guess-paper-size iw ih)) + (ps (or (and (null force-paper-size) + (doc-view-guess-paper-size iw ih)) (intern (completing-read "Paper size: " - (mapcar #'car doc-view-paper-sizes) + doc-view-paper-sizes nil t)))) (bb (doc-view-scale-bounding-box ps iw ih bb)) (x1 (nth 0 bb)) @@ -1294,16 +1262,15 @@ (let ((prev-pages doc-view-current-files)) (setq doc-view-current-files (sort (directory-files (doc-view-current-cache-dir) t - (concat "page-[0-9]+\\." - doc-view--image-file-extension) + (format doc-view--image-file-pattern + "[0-9]+") t) 'doc-view-sort)) (dolist (win (or (get-buffer-window-list buffer nil t) (list t))) (let* ((page (doc-view-current-page win)) (pagefile (expand-file-name - (format "page-%d.%s" - page doc-view--image-file-extension) + (format doc-view--image-file-pattern page) (doc-view-current-cache-dir)))) (when (or force (and (not (member pagefile prev-pages)) @@ -1369,7 +1336,7 @@ (doc-view-kill-proc) (setq buffer-read-only nil) (remove-overlays (point-min) (point-max) 'doc-view t) - (set (make-local-variable 'image-mode-winprops-alist) t) + (setq-local image-mode-winprops-alist t) ;; Switch to the previously used major mode or fall back to ;; normal mode. (doc-view-fallback-mode) @@ -1499,7 +1466,7 @@ (doc-view-current-cache-dir))) (> (length (directory-files (doc-view-current-cache-dir) - nil (concat "\\." doc-view--image-file-extension "\\'"))) + nil (format doc-view--image-file-pattern "[0-9]+"))) 0))) (defun doc-view-initiate-display () @@ -1511,7 +1478,7 @@ (if (doc-view-already-converted-p) (progn (message "DocView: using cached files!") - ;; Load the saved resolution + ;; Load the saved resolution. (let* ((res-file (expand-file-name "resolution.el" (doc-view-current-cache-dir))) (res @@ -1520,7 +1487,7 @@ (insert-file-contents res-file) (read (current-buffer)))))) (when (numberp res) - (set (make-local-variable 'doc-view-resolution) res))) + (setq-local doc-view-resolution res))) (doc-view-display (current-buffer) 'force)) (doc-view-convert-current-doc)) (message @@ -1590,23 +1557,23 @@ ((looking-at "%PDF") '(pdf)) ((looking-at "\367\002") '(dvi)) ((looking-at "AT&TFORM") '(djvu)))))) - (set (make-local-variable 'doc-view-doc-type) - (car (or (doc-view-intersection name-types content-types) - (when (and name-types content-types) - (error "Conflicting types: name says %s but content says %s" - name-types content-types)) - name-types content-types - (error "Cannot determine the document type")))))) + (setq-local doc-view-doc-type + (car (or (doc-view-intersection name-types content-types) + (when (and name-types content-types) + (error "Conflicting types: name says %s but content says %s" + name-types content-types)) + name-types content-types + (error "Cannot determine the document type")))))) (defun doc-view-set-up-single-converter () "Find the right single-page converter for the current document type" (pcase-let ((`(,conv-function ,type ,extension) (pcase doc-view-doc-type - (`djvu (list #'doc-view-djvu->png-1 'tiff "tif")) - (_ (list #'doc-view-pdf->png-1 'png "png"))))) + (`djvu (list #'doc-view-djvu->tiff-converter-ddjvu 'tiff "tif")) + (_ (list doc-view-pdf->png-converter-function 'png "png"))))) (setq-local doc-view-single-page-converter-function conv-function) (setq-local doc-view--image-type type) - (setq-local doc-view--image-file-extension extension))) + (setq-local doc-view--image-file-pattern (concat "page-%s." extension)))) ;;;###autoload (defun doc-view-mode () @@ -1631,8 +1598,7 @@ (unless (eq major-mode 'fundamental-mode) major-mode)))) (kill-all-local-variables) - (set (make-local-variable 'doc-view-previous-major-mode) - prev-major-mode)) + (setq-local doc-view-previous-major-mode prev-major-mode)) (dolist (var doc-view-saved-settings) (set (make-local-variable (car var)) (cdr var))) @@ -1644,7 +1610,7 @@ (doc-view-make-safe-dir doc-view-cache-directory) ;; Handle compressed files, remote files, files inside archives - (set (make-local-variable 'doc-view-buffer-file-name) + (setq-local doc-view-buffer-file-name (cond (jka-compr-really-do-compress ;; FIXME: there's a risk of name conflicts here. @@ -1683,20 +1649,19 @@ 'doc-view-new-window-function nil t) (image-mode-setup-winprops) - (set (make-local-variable 'mode-line-position) - '(" P" (:eval (number-to-string (doc-view-current-page))) - "/" (:eval (number-to-string (doc-view-last-page-number))))) + (setq-local mode-line-position + '(" P" (:eval (number-to-string (doc-view-current-page))) + "/" (:eval (number-to-string (doc-view-last-page-number))))) ;; Don't scroll unless the user specifically asked for it. - (set (make-local-variable 'auto-hscroll-mode) nil) - (set (make-local-variable 'mwheel-scroll-up-function) - 'doc-view-scroll-up-or-next-page) - (set (make-local-variable 'mwheel-scroll-down-function) - 'doc-view-scroll-down-or-previous-page) - (set (make-local-variable 'cursor-type) nil) + (setq-local auto-hscroll-mode nil) + (setq-local mwheel-scroll-up-function #'doc-view-scroll-up-or-next-page) + (setq-local mwheel-scroll-down-function + #'doc-view-scroll-down-or-previous-page) + (setq-local cursor-type nil) (use-local-map doc-view-mode-map) - (set (make-local-variable 'after-revert-hook) 'doc-view-reconvert-doc) - (set (make-local-variable 'bookmark-make-record-function) - 'doc-view-bookmark-make-record) + (add-hook 'after-revert-hook 'doc-view-reconvert-doc nil t) + (setq-local bookmark-make-record-function + #'doc-view-bookmark-make-record) (setq mode-name "DocView" buffer-read-only t major-mode 'doc-view-mode) @@ -1705,7 +1670,7 @@ ;; canonical view mode for PDF/PS/DVI files. This could be ;; switched on automatically depending on the value of ;; `view-read-only'. - (set (make-local-variable 'view-read-only) nil) + (setq-local view-read-only nil) (run-mode-hooks 'doc-view-mode-hook))) (defun doc-view-fallback-mode () ------------------------------------------------------------ revno: 111468 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-01-09 20:12:46 -0800 message: Misc make-tarball updates diff: === modified file 'admin/make-tarball.txt' --- admin/make-tarball.txt 2013-01-03 02:04:31 +0000 +++ admin/make-tarball.txt 2013-01-10 04:12:46 +0000 @@ -2,22 +2,46 @@ -- originally written by Gerd Moellmann, amended by Francesco Potortì with the initial help of Eli Zaretskii -For each step, check for possible errors. - -0. Decide on versions of automake and autoconf, and ensure you will + +Steps to take before starting on the first pretest in any release sequence: + +1. Decide on versions of automake and autoconf, and ensure you will have them available for the duration of the release process. +2. Consider increasing the value of the variable + `customize-changed-options-previous-release' in cus-edit.el to + refer to a newer version of Emacs. (This is probably needed only + when preparing the first pretest for a major Emacs release.) + Commit cus-edit.el if changed. + + +General steps (for each step, check for possible errors): + 1. `bzr update' (for a bound branch), or `bzr pull'. - bzr status # check for locally modified files + bzr status # check for locally modified files 2. Bootstrap to make 100% sure all elc files are up-to-date, and to make sure that the later tagged version will bootstrap, should it be necessary to check it out. 3. Regenerate the etc/AUTHORS file: - M-: (require 'authors) RET, M-x authors RET, save the *Authors* buffer. - If there are errors that relate to syntactically incorrect - ChangeLog entries, consider fixing them and repeating. + M-: (require 'authors) RET + M-x authors RET + + There is almost guaranteed to be an "*Authors Errors*" buffer with + problems caused by certain bad ChangeLog entries. You can ignore + the very old ones (eg lisp/erc has a lot). If there are errors + related to new entries (especially entries that are new since the + last pretest), see if you can fix them. If there was a ChangeLog + typo, fix it. If a file was deleted or renamed, consider adding + an appropriate entry to authors-ignored-files, authors-valid-file-names, + or authors-renamed-files-alist. + + If necessary, repeat M-x authors after making those changes. + Save the "*Authors*" buffer as etc/AUTHORS. + Check the diff looks reasonable. Maybe add entries to + authors-ambiguous-files or authors-aliases, and repeat. + Commit any fixes to ChangeLogs or authors.el. 4. Set the version number (M-x load-file RET admin/admin.el RET, then M-x set-version RET). For a release, add released ChangeLog @@ -26,20 +50,18 @@ For a pretest, start at version .90. After .99, use .990 (so that it sorts). - If needed, increment the value of the variable - `customize-changed-options-previous-release' in cus-edit.el to - refer to a newer release of Emacs. (This is probably needed only - when preparing a major Emacs release, or branching for it.) - 5. autoreconf -i -I m4 --force make bootstrap -6. Commit etc/AUTHORS, all the files changed by M-x set-version, and - lisp/cus-edit.el (if modified). - Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit lisp/ldefs-boot.el. +6. Copy lisp/loaddefs.el to lisp/ldefs-boot.el. + + Commit etc/AUTHORS, lisp/ldefs-boot.el, and the files changed + by M-x set-version. For a release, also commit the ChangeLog files in all directories. -7. make-dist --snapshot. Check the contents of the new tar with +7. ./make-dist --snapshot --no-compress + + Check the contents of the new tar with admin/diff-tar-files against an older tar file. Some old pretest tarballs may be found at ; old release tarballs are at . @@ -49,15 +71,15 @@ something like `find . | sort' in a clean bzr tree, and compare the results against the new tar contents. -8. tar -zxf emacs-NEW.tar.gz; cd emacs-NEW - ./configure && make && make -n install +8. tar -xf emacs-NEW.tar; cd emacs-NEW + ./configure --prefix=/tmp/emacs && make && make install Use `script' or M-x compile to save the compilation log in compile-NEW.log and compare it against an old one. The easiest way to do that is to visit the old log in Emacs, change the version number of the old Emacs to __, do the same with the new log and do M-x ediff. Especially check that Info files aren't built. -9. cd EMACS_ROOT_DIR; bzr tag TAG +9. cd EMACS_ROOT_DIR && bzr tag TAG TAG is emacs-XX.Y.ZZ for a pretest, emacs-XX.Y for a release. Shortly before the release, cut the version branch also, and open @@ -65,16 +87,37 @@ be sent to the emacs-diffs mailing list (by default, the list normally only gets commits to the trunk). -10. Now you should upload the files to the GNU ftp server. In order to +10. Decide what compression schemes to offer. + For a release, at least gz and xz: + gzip --best -c emacs-NEW.tar > emacs-NEW.tar.gz + xz -c emacs-NEW.tar > emacs-NEW.tar.xz + + Now you should upload the files to the GNU ftp server. In order to do that, you must be registered as an Emacs maintainer and have your GPG key acknowledged by the ftp people. For instructions, see http://www.gnu.org/prep/maintain/html_node/Automated-Upload-Registration.html - You can use the gnulib script "gnupload" to upload each FILE, like this: - gnupload --to alpha.gnu.org:emacs/pretest FILE (for a pretest) - gnupload --to ftp.gnu.org:emacs FILE (for a release) - - Instead of using gnupload, for each FILE, create a detached GPG - binary signature and a clearsigned directive file like this: + The simplest method is to use the gnulib + script "build-aux/gnupload" to upload each FILE, like this: + + For a pretest: + gnupload [--user your@gpg.key.email] --to alpha.gnu.org:emacs/pretest \ + FILE.gz FILE.xz ... + + For a release: + gnupload [--user your@gpg.key.email] --to ftp.gnu.org:emacs \ + FILE.gz FILE.xz ... + + You only need the --user part if you have multiple GPG keys and do + not want to use the default. + Obviously, if you do not have a fast uplink, be prepared for the + upload to take a while. + + + If you prefer to do it yourself rather than use gnupload: + + For each FILE, create a detached GPG binary signature and a + clearsigned directive file like this: + gpg -b FILE echo directory: emacs/pretest > FILE.directive (for a pretest) echo directory: emacs > FILE.directive (for a release) @@ -85,13 +128,12 @@ For a pretest, place the files in /incoming/alpha instead, so that they appear on ftp://alpha.gnu.org/. - For a release, upload xz and bz2 tarfiles as well; this can save a lot - of bandwidth. - 11. After five minutes, verify that the files are visible at - ftp://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, at + ftp://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, or ftp://ftp.gnu.org/gnu/emacs/ for a release. + Download them and check the signatures. Check they build. + 12. For a pretest, announce it on emacs-devel and info-gnu-emacs@gnu.org. For a release, also announce it on info-gnu@gnu.org. (Probably bcc the info- addresses to make it less likely that people will @@ -99,3 +141,4 @@ 13. For a release, update the Emacs homepage in the web repository. Also add the new NEWS file as NEWS.xx.y. + Maybe regenerate the html manuals, update the FAQ, etc, etc. ------------------------------------------------------------ revno: 111467 [merge] committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-01-09 22:43:02 -0500 message: Merge from emacs-24 diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-01-03 02:36:29 +0000 +++ admin/ChangeLog 2013-01-10 03:43:02 +0000 @@ -132,15 +132,14 @@ * grammars/bovine-grammar.el (bovine--grammar-newstyle-unquote): Remove. - (bovine-grammar-expand-form): Test for emacs-major-version. + (bovine-grammar-expand-form): Test for emacs-major-version. * grammars/c.by: Add EXPLICIT to keyword tokens. - - * grammars/f90.by: Add %provide token. - - * grammar/grammar.wy (semantic-grammar-lexer): Remove, since it + Add %provide token. + + * grammars/grammar.wy (semantic-grammar-lexer): Remove, since it was copied to grammar.el. New %provide token to generate prefix - which conforms with Emacs conventions. Remove lexer definition, + which conforms with Emacs conventions. Remove lexer definition, which is now in grammar.el. 2012-09-27 Glenn Morris @@ -184,7 +183,7 @@ 2012-09-13 Paul Eggert Simplify SIGIO usage (Bug#12408). - * CPP_DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) + * CPP-DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) (BROKEN_SIGPTY, NO_TERMIO): Remove. 2012-09-11 Paul Eggert === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-01-06 20:34:54 +0000 +++ doc/lispref/ChangeLog 2013-01-10 03:43:02 +0000 @@ -1,3 +1,8 @@ +2013-01-09 Glenn Morris + + * commands.texi (Interactive Codes): + Whitespace does not terminate interactive "S". (Bug#13393) + 2013-01-06 Chong Yidong * windows.texi (Vertical Scrolling): Fix typos (Bug#13267). === modified file 'doc/lispref/commands.texi' --- doc/lispref/commands.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/commands.texi 2013-01-09 21:26:08 +0000 @@ -471,10 +471,10 @@ these characters in the input.) Prompt. @item S -An interned symbol whose name is read in the minibuffer. Any whitespace -character terminates the input. (Use @kbd{C-q} to include whitespace in -the string.) Other characters that normally terminate a symbol (e.g., -parentheses and brackets) do not do so here. Prompt. +An interned symbol whose name is read in the minibuffer. Terminate +the input with either @kbd{C-j} or @key{RET}. Other characters that +normally terminate a symbol (e.g., whitespace, parentheses and +brackets) do not do so here. Prompt. @item U A key sequence or @code{nil}. Can be used after a @samp{k} or === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-01-02 16:13:04 +0000 +++ etc/ChangeLog 2013-01-10 03:43:02 +0000 @@ -85,7 +85,7 @@ 2012-10-01 Eric Ludlam - * srecode/cc.srt, srecode/ede-autoconf.srt: New files. + * srecode/c.srt, srecode/ede-autoconf.srt: New files. * srecode/cpp.srt: Move parts to c.srt. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-10 02:45:31 +0000 +++ lisp/ChangeLog 2013-01-10 03:43:02 +0000 @@ -1,3 +1,37 @@ +2013-01-10 Glenn Morris + + * emacs-lisp/authors.el (authors-ignored-files) + (authors-valid-file-names, authors-renamed-files-alist): + Add some more entries. + +2013-01-10 Stefan Monnier + + * image-mode.el (image-mode-winprops): Don't throw away the fallback + `t' pseudo-window entry. + +2013-01-10 Alan Mackenzie + + Fix bugs in the c-parse-state mechanism. Reuse some markers + instead of continually generating new ones. + + * progmodes/cc-engine.el (c-state-old-cpp-beg-marker) + (c-state-old-cpp-end-marker): New variables. + (c-append-lower-brace-pair-to-state-cache): Start a backward + search for "}" definitively outside CPP constructs. + (c-remove-stale-state-cache): Inform the caller of a need to + search back for a brace pair in certain circumstances. + (c-state-maybe-marker): New macro. + (c-parse-state): Reuse markers when appropriate. + +2013-01-10 Glenn Morris + + * simple.el (execute-extended-command): Doc fix. + Bind prefix-arg around read-extended-command, for prompt. (Bug#13395) + +2013-01-10 Chong Yidong + + * faces.el (read-face-name): Doc fix. + 2013-01-10 Roland Winkler * emacs-lisp/crm.el: Allow any regexp for separators. @@ -5953,7 +5987,7 @@ 2012-08-08 Fabián Ezequiel Gallina - * progmodes/python.el Fixed defsubst warning. + * progmodes/python.el: Fix defsubst warning. (python-syntax-context) Rename from python-info-ppss-context. (python-syntax-context-type): Rename from python-info-ppss-context-type. === modified file 'lisp/emacs-lisp/authors.el' --- lisp/emacs-lisp/authors.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/authors.el 2013-01-10 02:30:06 +0000 @@ -295,6 +295,14 @@ "calc/INSTALL" "calc/Makefile" "vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/ "emacsver.texi.in" + "vpath.sed" + "Cocoa/Emacs.base/Contents/Info.plist" + "Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" + "GNUstep/Emacs.base/Resources/Info-gnustep.plist" + "GNUstep/Emacs.base/Resources/Emacs.desktop" + "Cocoa/Emacs.base/Contents/Resources/English.lproj" + ;; Only existed briefly, then deleted: + "coccinelle/overlay.cocci" "coccinelle/symbol.cocci" ;; MH-E stuff not in Emacs: "import-emacs" "release-utils" ;; Erc stuff not in Emacs: @@ -540,6 +548,7 @@ "makedist.bat" "makefile.def" "makefile.nt" + "ns.mk" "debug.bat.in" "emacs.bat.in" ".gdbinit-union" "alloca.s" @@ -553,15 +562,17 @@ "ymakefile" "permute-index" "index.perm" "ibmrs6000.inp" - "b2m.c" "b2m.1" "b2m.pl" + "b2m.c" "b2m.1" "b2m.pl" "rcs-checkin.1" "emacs.bash" "emacs.csh" "ms-kermit" "emacs.ico" "emacs21.ico" + "emacs.py" "emacs2.py" "emacs3.py" "BABYL" "LPF" "LEDIT" "OTHER.EMACSES" "emacs16_mac.png" "emacs24_mac.png" "emacs256_mac.png" "emacs32_mac.png" "emacs48_mac.png" "emacs512_mac.png" "revdiff" ; admin/ + "vcdiff" "rcs-checkin" "tindex.pl" "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/ "mac-fix-env.m" ;; Deleted vms stuff: @@ -580,6 +591,7 @@ ("s/windowsnt.h" . "s/ms-w32.h") ("s/ms-w32.h" . "inc/ms-w32.h") ("winnt.el" . "w32-fns.el") + ("emacs.manifest" . "emacs-x86.manifest") ("config.emacs" . "configure") ("configure.in" . "configure.ac") ("config.h.dist" . "config.in") @@ -616,6 +628,8 @@ ("build-install" . "build-ins.in") ("build-install.in" . "build-ins.in") ("unidata/Makefile" . "unidata/Makefile.in") + ("move-if-change" . "build-aux/move-if-change") + ("update-subdirs" . "build-aux/update-subdirs") ;; Not renamed, but we only have the latter in the Emacs repo. ("trampver.texi.in" . "trampver.texi") ("e/eterm" . "e/eterm-color") === modified file 'lisp/faces.el' --- lisp/faces.el 2013-01-02 16:13:04 +0000 +++ lisp/faces.el 2013-01-10 03:43:02 +0000 @@ -929,27 +929,29 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun read-face-name (prompt &optional default multiple) - "Read a face, defaulting to the face or faces at point. -If the text at point has the property `read-face-name', that -overrides the `face' property for determining the default. - -PROMPT should be a string that describes what the caller will do -with the face; it should not end in a space. - + "Read one or more face names, defaulting to the face(s) at point. +PROMPT should be a prompt string; it should not end in a space or +a colon. + +The optional argument DEFAULT specifies the default face name(s) +to return if the user just types RET. If its value is non-nil, +it should be a list of face names (symbols); in that case, the +default return value is the `car' of DEFAULT (if the argument +MULTIPLE is non-nil), or DEFAULT (if MULTIPLE is nil). See below +for the meaning of MULTIPLE. + +If DEFAULT is nil, the list of default face names is taken from +the `read-face-name' property of the text at point, or, if that +is nil, from the `face' property of the text at point. This function uses `completing-read-multiple' with \",\" as the -separator character, i.e. - - - - - -The optional argument DEFAULT provides the value to display in the -minibuffer prompt that is returned if the user just types RET -unless DEFAULT is a string (in which case nil is returned). - -If MULTIPLE is non-nil, return a list of faces (possibly only one). -Otherwise, return a single face." +separator character. Thus, the user may enter multiple face +names, separated by commas. The optional argument MULTIPLE +specifies the form of the return value. If MULTIPLE is non-nil, +return a list of face names; if the user entered just one face +name, the return value would be a list of one face name. +Otherwise, return a single face name; if the user entered more +than one face name, return only the first one." (let ((faceprop (or (get-char-property (point) 'read-face-name) (get-char-property (point) 'face))) (aliasfaces nil) === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2013-01-01 09:11:05 +0000 +++ lisp/image-mode.el 2013-01-09 22:47:27 +0000 @@ -63,8 +63,9 @@ (when cleanup (setq image-mode-winprops-alist (delq nil (mapcar (lambda (winprop) - (if (window-live-p (car-safe winprop)) - winprop)) + (let ((w (car-safe winprop))) + (if (or (not (windowp w)) (window-live-p w)) + winprop))) image-mode-winprops-alist)))) (let ((winprops (assq window image-mode-winprops-alist))) ;; For new windows, set defaults from the latest. === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/cc-engine.el 2013-01-09 21:33:00 +0000 @@ -2464,8 +2464,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Variables which keep track of preprocessor constructs. +(defvar c-state-old-cpp-beg-marker nil) +(make-variable-buffer-local 'c-state-old-cpp-beg-marker) (defvar c-state-old-cpp-beg nil) (make-variable-buffer-local 'c-state-old-cpp-beg) +(defvar c-state-old-cpp-end-marker nil) +(make-variable-buffer-local 'c-state-old-cpp-end-marker) (defvar c-state-old-cpp-end nil) (make-variable-buffer-local 'c-state-old-cpp-end) ;; These are the limits of the macro containing point at the previous call of @@ -2653,13 +2657,21 @@ ;; reduce the time wasted in repeated fruitless searches in brace deserts. (save-excursion (save-restriction - (let ((bra from) ce ; Positions of "{" and "}". - new-cons - (cache-pos (c-state-cache-top-lparen)) ; might be nil. - (macro-start-or-from - (progn (goto-char from) - (c-beginning-of-macro) - (point)))) + (let* (new-cons + (cache-pos (c-state-cache-top-lparen)) ; might be nil. + (macro-start-or-from + (progn (goto-char from) + (c-beginning-of-macro) + (point))) + (bra ; Position of "{". + ;; Don't start scanning in the middle of a CPP construct unless + ;; it contains HERE - these constructs, in Emacs, are "commented + ;; out" with category properties. + (if (eq (c-get-char-property macro-start-or-from 'category) + 'c-cpp-delimiter) + macro-start-or-from + from)) + ce) ; Position of "}" (or upper-lim (setq upper-lim from)) ;; If we're essentially repeating a fruitless search, just give up. @@ -2899,7 +2911,9 @@ (point-max) (min (point-max) c-state-old-cpp-beg))) (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim)) + (setq scan-back-pos (car-safe (car c-state-cache))) (setq c-state-cache (cdr c-state-cache))) + ;; If `upper-lim' is inside the last recorded brace pair, remove its ;; RBrace and indicate we'll need to search backwards for a previous ;; brace pair. @@ -3324,6 +3338,13 @@ (c-with-cpps-commented-out (c-invalidate-state-cache-1 here))))) +(defmacro c-state-maybe-marker (place marker) + ;; If PLACE is non-nil, return a marker marking it, otherwise nil. + ;; We (re)use MARKER. + `(and ,place + (or ,marker (setq ,marker (make-marker))) + (set-marker ,marker ,place))) + (defun c-parse-state () ;; This is a wrapper over `c-parse-state-1'. See that function for a ;; description of the functionality and return value. @@ -3350,9 +3371,10 @@ (c-parse-state-1)) (c-with-cpps-commented-out (c-parse-state-1)))) - (setq c-state-old-cpp-beg (and here-cpp-beg (copy-marker here-cpp-beg t)) - c-state-old-cpp-end (and here-cpp-end (copy-marker here-cpp-end t))) - ))) + (setq c-state-old-cpp-beg + (c-state-maybe-marker here-cpp-beg c-state-old-cpp-beg-marker) + c-state-old-cpp-end + (c-state-maybe-marker here-cpp-end c-state-old-cpp-end-marker))))) ;; Debug tool to catch cache inconsistencies. This is called from ;; 000tests.el. === modified file 'lisp/simple.el' --- lisp/simple.el 2013-01-08 20:15:15 +0000 +++ lisp/simple.el 2013-01-10 03:43:02 +0000 @@ -1391,14 +1391,16 @@ ;; Aaron S. Hawley 2009-08-24 "Read function name, then read its arguments and call it. -To pass a numeric argument to the command you are invoking with, specify +To pass a numeric argument to the command you are invoking, specify the numeric argument to this command. Noninteractively, the argument PREFIXARG is the prefix argument to give to the command you invoke, if it asks for an argument." (interactive (list current-prefix-arg (read-extended-command))) ;; Emacs<24 calling-convention was with a single `prefixarg' argument. - (if (null command-name) (setq command-name (read-extended-command))) + (if (null command-name) + (setq command-name (let ((current-prefix-arg prefixarg)) ; for prompt + (read-extended-command)))) (let* ((function (and (stringp command-name) (intern-soft command-name))) (binding (and suggest-key-bindings (not executing-kbd-macro) ------------------------------------------------------------ revno: 111466 author: Roland Winkler committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-01-09 21:45:31 -0500 message: * lisp/emacs-lisp/crm.el: Allow any regexp for separators. (crm-default-separator): All spaces around the default comma separator. (crm--completion-command): New macro. (crm-completion-help, crm-complete, crm-complete-word): Use it. (crm-complete-and-exit): Handle non-single-char separators. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-01-08 23:50:40 +0000 +++ etc/NEWS 2013-01-10 02:45:31 +0000 @@ -66,6 +66,9 @@ * Changes in Specialized Modes and Packages in Emacs 24.4 +** completing-read-multiple's separator can now be a regexp. +The default separator is changed to allow surrounding spaces around the comma. + ** Battery *** Battery information via the BSD `apm' utility is now supported. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-09 21:24:42 +0000 +++ lisp/ChangeLog 2013-01-10 02:45:31 +0000 @@ -1,3 +1,11 @@ +2013-01-10 Roland Winkler + + * emacs-lisp/crm.el: Allow any regexp for separators. + (crm-default-separator): All spaces around the default comma separator. + (crm--completion-command): New macro. + (crm-completion-help, crm-complete, crm-complete-word): Use it. + (crm-complete-and-exit): Handle non-single-char separators. + 2013-01-09 Elias Pipping * doc-view.el: Add support for DjVu (bug#13164). === modified file 'lisp/emacs-lisp/crm.el' --- lisp/emacs-lisp/crm.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/crm.el 2013-01-10 02:45:31 +0000 @@ -30,12 +30,12 @@ ;; a single prompt, optionally using completion. ;; Multiple strings are specified by separating each of the strings -;; with a prespecified separator character. For example, if the -;; separator character is a comma, the strings 'alice', 'bob', and +;; with a prespecified separator regexp. For example, if the +;; separator regexp is ",", the strings 'alice', 'bob', and ;; 'eve' would be specified as 'alice,bob,eve'. -;; The default value for the separator character is the value of -;; `crm-default-separator' (comma). The separator character may be +;; The default value for the separator regexp is the value of +;; `crm-default-separator' (comma). The separator regexp may be ;; changed by modifying the value of `crm-separator'. ;; Contiguous strings of non-separator-characters are referred to as @@ -96,14 +96,14 @@ ;; first revamped version ;;; Code: -(defconst crm-default-separator "," - "Default separator for `completing-read-multiple'.") +(defconst crm-default-separator "[ \t]*,[ \t]*" + "Default separator regexp for `completing-read-multiple'.") (defvar crm-separator crm-default-separator - "Separator used for separating strings in `completing-read-multiple'. -It should be a single character string that doesn't appear in the list of -completion candidates. Modify this value to make `completing-read-multiple' -use a separator other than `crm-default-separator'.") + "Separator regexp used for separating strings in `completing-read-multiple'. +It should be a regexp that does not match the list of completion candidates. +Modify this value to make `completing-read-multiple' use a separator other +than `crm-default-separator'.") (defvar crm-local-completion-map (let ((map (make-sparse-keymap))) @@ -173,13 +173,17 @@ (overlay-put ol 'field (make-symbol "crm")) ol)) +(defmacro crm--completion-command (command) + "Make COMMAND a completion command for `completing-read-multiple'." + `(let ((ol (crm--select-current-element))) + (unwind-protect + ,command + (delete-overlay ol)))) + (defun crm-completion-help () "Display a list of possible completions of the current minibuffer element." (interactive) - (let ((ol (crm--select-current-element))) - (unwind-protect - (minibuffer-completion-help) - (delete-overlay ol))) + (crm--completion-command (minibuffer-completion-help)) nil) (defun crm-complete () @@ -188,19 +192,13 @@ Return t if the current element is now a valid match; otherwise return nil." (interactive) - (let ((ol (crm--select-current-element))) - (unwind-protect - (minibuffer-complete) - (delete-overlay ol)))) + (crm--completion-command (minibuffer-complete))) (defun crm-complete-word () "Complete the current element at most a single word. Like `minibuffer-complete-word' but for `completing-read-multiple'." (interactive) - (let ((ol (crm--select-current-element))) - (unwind-protect - (minibuffer-complete-word) - (delete-overlay ol)))) + (crm--completion-command (minibuffer-complete-word))) (defun crm-complete-and-exit () "If all of the minibuffer elements are valid completions then exit. @@ -222,9 +220,10 @@ (setq doexit nil)) (goto-char (overlay-end ol)) (delete-overlay ol)) - (not (eobp)))) + (not (eobp))) + (looking-at crm-separator)) ;; Skip to the next element. - (forward-char 1)) + (goto-char (match-end 0))) (if doexit (exit-minibuffer)))) (defun crm--choose-completion-string (choice buffer base-position @@ -248,12 +247,12 @@ single prompt, optionally using completion. Multiple strings are specified by separating each of the strings with -a prespecified separator character. For example, if the separator -character is a comma, the strings 'alice', 'bob', and 'eve' would be +a prespecified separator regexp. For example, if the separator +regexp is \",\", the strings 'alice', 'bob', and 'eve' would be specified as 'alice,bob,eve'. -The default value for the separator character is the value of -`crm-default-separator' (comma). The separator character may be +The default value for the separator regexp is the value of +`crm-default-separator' (comma). The separator regexp may be changed by modifying the value of `crm-separator'. Contiguous strings of non-separator-characters are referred to as @@ -282,8 +281,8 @@ (map (if require-match crm-local-must-match-map crm-local-completion-map)) - ;; If the user enters empty input, read-from-minibuffer returns - ;; the empty string, not DEF. + ;; If the user enters empty input, `read-from-minibuffer' + ;; returns the empty string, not DEF. (input (read-from-minibuffer prompt initial-input map nil hist def inherit-input-method))) ------------------------------------------------------------ revno: 111465 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-01-09 18:19:44 -0800 message: Merge from gnulib. diff: === modified file 'ChangeLog' --- ChangeLog 2013-01-04 19:22:37 +0000 +++ ChangeLog 2013-01-10 02:19:44 +0000 @@ -1,3 +1,8 @@ +2013-01-10 Paul Eggert + + Merge from gnulib, incorporating: + 2013-01-09 stdlib: port to Solaris 2.6 + 2013-01-04 Glenn Morris * info/dir: Add htmlfontify. === modified file 'lib/getopt.in.h' --- lib/getopt.in.h 2013-01-01 09:11:05 +0000 +++ lib/getopt.in.h 2013-01-10 02:19:44 +0000 @@ -49,7 +49,9 @@ linkers. */ #if defined __GETOPT_PREFIX && !defined __need_getopt # if !@HAVE_GETOPT_H@ +# define __need_system_stdlib_h # include +# undef __need_system_stdlib_h # include # include # endif === modified file 'lib/stdlib.in.h' --- lib/stdlib.in.h 2013-01-01 09:11:05 +0000 +++ lib/stdlib.in.h 2013-01-10 02:19:44 +0000 @@ -20,8 +20,9 @@ #endif @PRAGMA_COLUMNS@ -#if defined __need_malloc_and_calloc -/* Special invocation convention inside glibc header files. */ +#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc +/* Special invocation conventions inside some gnulib header files, + and inside some glibc header files, respectively. */ #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ === modified file 'lib/unistd.in.h' --- lib/unistd.in.h 2013-01-02 16:37:04 +0000 +++ lib/unistd.in.h 2013-01-10 02:19:44 +0000 @@ -79,7 +79,9 @@ /* Solaris declares getcwd not only in but also in . */ /* But avoid namespace pollution on glibc systems. */ #ifndef __GLIBC__ +# define __need_system_stdlib_h # include +# undef __need_system_stdlib_h #endif /* Native Windows platforms declare chdir, getcwd, rmdir in ------------------------------------------------------------ revno: 111464 author: Aaron S. Hawley committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-01-09 16:29:27 -0500 message: * test/automated/undo-tests.el (undo-test0): Adjust error to code change. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-01-08 19:13:31 +0000 +++ test/ChangeLog 2013-01-09 21:29:27 +0000 @@ -1,3 +1,7 @@ +2013-01-09 Aaron S. Hawley + + * automated/undo-tests.el (undo-test0): Adjust error to code change. + 2013-01-08 Aaron S. Hawley * automated/undo-tests.el: New file. === modified file 'test/automated/undo-tests.el' --- test/automated/undo-tests.el 2013-01-08 19:13:31 +0000 +++ test/automated/undo-tests.el 2013-01-09 21:29:27 +0000 @@ -79,7 +79,7 @@ (undo) (should (equal (should-error (undo-more nil)) - '(wrong-type-argument integerp nil))) + '(wrong-type-argument number-or-marker-p nil))) (undo-more 7) (should (string-equal "" (buffer-string))))) ------------------------------------------------------------ revno: 111463 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13164 author: Elias Pipping committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-01-09 16:24:42 -0500 message: * lisp/doc-view.el: Add support for DjVu. (doc-view-djvu->png-converter-function): New config var. (doc-view-single-page-converter-function, doc-view--image-type) (doc-view--image-file-extension): New vars. (doc-view-mode): Initialize them. (doc-view-goto-page): Use them. (doc-view-mode-p): Add support for ddjvu. (doc-view-djvu->png-converter-ddjvu, doc-view-djvu->png-1) (doc-view-set-up-single-converter): New funs. (doc-view-pdf/ps->png): Extend for djvu. (doc-view-document->png): Rename from doc-view-pdf->png. (doc-view-convert-current-doc): Handle djvu. (doc-view-insert-image, doc-view-display) (doc-view-already-converted-p): Don't hardcode png. (doc-view-set-doc-type): Recognize djvu docs. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-09 19:48:42 +0000 +++ lisp/ChangeLog 2013-01-09 21:24:42 +0000 @@ -1,5 +1,23 @@ 2013-01-09 Elias Pipping + * doc-view.el: Add support for DjVu (bug#13164). + (doc-view-djvu->png-converter-function): New config var. + (doc-view-single-page-converter-function, doc-view--image-type) + (doc-view--image-file-extension): New vars. + (doc-view-mode): Initialize them. + (doc-view-goto-page): Use them. + (doc-view-mode-p): Add support for ddjvu. + (doc-view-djvu->png-converter-ddjvu, doc-view-djvu->png-1) + (doc-view-set-up-single-converter): New funs. + (doc-view-pdf/ps->png): Extend for djvu. + (doc-view-document->png): Rename from doc-view-pdf->png. + (doc-view-convert-current-doc): Handle djvu. + (doc-view-insert-image, doc-view-display) + (doc-view-already-converted-p): Don't hardcode png. + (doc-view-set-doc-type): Recognize djvu docs. + +2013-01-09 Elias Pipping + * doc-view.el: Add support for mupdf converter (bug#13164). (doc-view-pdfdraw-program, doc-view-pdf->png-converter-function) (doc-view-ps->png-converter-function): New config vars. === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2013-01-09 19:48:42 +0000 +++ lisp/doc-view.el 2013-01-09 21:24:42 +0000 @@ -145,7 +145,7 @@ ;;;; Customization Options (defgroup doc-view nil - "In-buffer viewer for PDF, PostScript and DVI files." + "In-buffer viewer for PDF, PostScript, DVI, and DJVU files." :link '(function-link doc-view) :version "22.2" :group 'applications @@ -174,6 +174,15 @@ function) :version "24.4") +;; FIXME: Get rid of it: there's no choice. +(defcustom doc-view-djvu->png-converter-function + 'doc-view-djvu->png-converter-ddjvu + "Function to call to convert a DJVU file into a PNG file" + :type '(radio (function-item doc-view-djvu->png-converter-ddjvu + :doc "Use ddjvu") + function)) + +;; FIXME: Get rid of it: there's no choice. (defcustom doc-view-ps->png-converter-function 'doc-view-ps->png-converter-ghostscript "Function to call to convert a PS file into a PNG file." @@ -344,6 +353,20 @@ "The type of document in the current buffer. Can be `dvi', `pdf', or `ps'.") +(defvar doc-view-single-page-converter-function nil + "Function to call to convert a single page of the document to a bitmap file. +May operate on the source document or on some intermediate (typically PDF) +conversion of it.") + +(defvar doc-view--image-type nil + "The type of image in the current buffer. +Can be `png' or `tiff'.") + +(defvar doc-view--image-file-extension nil + ;; FIXME: Replace it with a `format' string, like "page-%d.png". + "The file extension of the image type in the current buffer. +Can be `png' or `tif'.") + ;;;; DocView Keymaps (defvar doc-view-mode-map @@ -482,24 +505,26 @@ ;; We used to find the file name from doc-view-current-files but ;; that's not right if the pages are not generated sequentially ;; or if the page isn't in doc-view-current-files yet. - (let ((file (expand-file-name (format "page-%d.png" page) - (doc-view-current-cache-dir)))) + (let ((file (expand-file-name + (format "page-%d.%s" page doc-view--image-file-extension) + (doc-view-current-cache-dir)))) (doc-view-insert-image file :pointer 'arrow) (set-window-hscroll (selected-window) hscroll) (when (and (not (file-exists-p file)) doc-view-current-converter-processes) ;; The PNG file hasn't been generated yet. - (doc-view-pdf->png-1 doc-view-buffer-file-name file page - (let ((win (selected-window))) - (lambda () - (and (eq (current-buffer) (window-buffer win)) - ;; If we changed page in the mean - ;; time, don't mess things up. - (eq (doc-view-current-page win) page) - ;; Make sure we don't infloop. - (file-readable-p file) - (with-selected-window win - (doc-view-goto-page page)))))))) + (funcall doc-view-single-page-converter-function + doc-view-buffer-file-name file page + (let ((win (selected-window))) + (lambda () + (and (eq (current-buffer) (window-buffer win)) + ;; If we changed page in the mean + ;; time, don't mess things up. + (eq (doc-view-current-page win) page) + ;; Make sure we don't infloop. + (file-readable-p file) + (with-selected-window win + (doc-view-goto-page page)))))))) (overlay-put (doc-view-current-overlay) 'help-echo (doc-view-current-info)))) @@ -692,6 +717,8 @@ (and doc-view-unoconv-program (executable-find doc-view-unoconv-program) (doc-view-mode-p 'pdf))) + ((eq type 'djvu) + (executable-find "ddjvu")) (t ;; unknown image type nil)))) @@ -863,6 +890,17 @@ (defalias 'doc-view-ps->png-converter-ghostscript 'doc-view-pdf->png-converter-ghostscript) +(defun doc-view-djvu->png-converter-ddjvu (resolution djvu png &optional page) + `((command . "ddjvu") + (arguments . ("-format=tiff" + ;; ddjvu only accepts the range 1-999. + ,(format "-scale=%d" resolution) + ;; -eachpage was only added after djvulibre-3.5.25.3! + ,@(unless page '("-eachpage")) + ,@(if page `(,(format "-page=%d" page))) + ,djvu + ,png)))) + (defun doc-view-pdf->png-converter-mupdf (resolution pdf png &optional page) `((command . ,doc-view-pdfdraw-program) (arguments . (,(concat "-o" png) @@ -879,13 +917,15 @@ callback)) (defun doc-view-pdf/ps->png (pdf-ps png) + ;; FIXME: Fix name and docstring to account for djvu&tiff. "Convert PDF-PS to PNG asynchronously." (let ((invocation - (pcase doc-view-doc-type - (`pdf (funcall doc-view-pdf->png-converter-function - (round doc-view-resolution) pdf-ps png)) - (_ (funcall doc-view-ps->png-converter-function - (round doc-view-resolution) pdf-ps png))))) + (funcall (pcase doc-view-doc-type + (`pdf doc-view-pdf->png-converter-function) + (`djvu doc-view-djvu->png-converter-function) + (_ doc-view-ps->png-converter-function)) + (round doc-view-resolution) pdf-ps png))) + (doc-view-start-process "pdf/ps->png" (cdr (assoc 'command invocation)) (cdr (assoc 'arguments invocation)) @@ -918,9 +958,20 @@ (cdr (assoc 'arguments invocation)) callback))) +(defun doc-view-djvu->png-1 (djvu png page callback) + "Convert a PAGE of a DJVU file to bitmap asynchronously. +Call CALLBACK with no arguments when done." + (let ((invocation (funcall doc-view-djvu->png-converter-function + (round doc-view-resolution) djvu png page))) + (doc-view-start-process + "djvu->png" (cdr (assoc 'command invocation)) + (cdr (assoc 'arguments invocation)) + callback))) + (declare-function clear-image-cache "image.c" (&optional filter)) -(defun doc-view-pdf->png (pdf png pages) +(defun doc-view-document->png (pdf png pages single-page-converter) + ;; FIXME: Fix docstring. "Convert a PDF file to PNG asynchronously. Start by converting PAGES, and then the rest." (if (null pages) @@ -930,11 +981,11 @@ ;; a single page anyway, and of the remaining 1%, few cases will have ;; consecutive pages, it's not worth the trouble. (let ((rest (cdr pages))) - (doc-view-pdf->png-1 - pdf (format png (car pages)) (car pages) + (funcall single-page-converter + pdf (format png (car pages)) (car pages) (lambda () (if rest - (doc-view-pdf->png pdf png rest) + (doc-view-document->png pdf png rest) ;; Yippie, the important pages are done, update the display. (clear-image-cache) ;; For the windows that have a message (like "Welcome to @@ -942,8 +993,8 @@ ;; not sufficient. (dolist (win (get-buffer-window-list (current-buffer) nil 'visible)) (with-selected-window win - (when (stringp (get-char-property (point-min) 'display)) - (doc-view-goto-page (doc-view-current-page))))) + (when (stringp (get-char-property (point-min) 'display)) + (doc-view-goto-page (doc-view-current-page))))) ;; Convert the rest of the pages. (doc-view-pdf/ps->png pdf png))))))) @@ -1013,8 +1064,9 @@ ;; preserves the horizontal/vertical scroll settings (which are otherwise ;; resets during the redisplay). (setq doc-view-pending-cache-flush t) - (let ((png-file (expand-file-name "page-%d.png" - (doc-view-current-cache-dir)))) + (let ((png-file (expand-file-name + (concat "page-%d." doc-view--image-file-extension) + (doc-view-current-cache-dir)))) (make-directory (doc-view-current-cache-dir) t) (pcase doc-view-doc-type (`dvi @@ -1027,11 +1079,12 @@ ;; ODF files have to be converted to PDF before Ghostscript can ;; process it. (let ((pdf (doc-view-current-cache-doc-pdf)) - (opdf (expand-file-name (concat (file-name-base doc-view-buffer-file-name) - ".pdf") - doc-view-current-cache-dir)) + (opdf (expand-file-name + (concat (file-name-base doc-view-buffer-file-name) + ".pdf") + doc-view-current-cache-dir)) (png-file png-file)) - ;; The unoconv tool only supports a output directory, but no + ;; The unoconv tool only supports an output directory, but no ;; file name. It's named like the input file with the ;; extension replaced by pdf. (doc-view-odf->pdf doc-view-buffer-file-name @@ -1042,7 +1095,12 @@ (`pdf (let ((pages (doc-view-active-pages))) ;; Convert PDF to PNG images starting with the active pages. - (doc-view-pdf->png doc-view-buffer-file-name png-file pages))) + (doc-view-document->png doc-view-buffer-file-name png-file pages + 'doc-view-pdf->png-1))) + (`djvu + (let ((pages (doc-view-active-pages))) + (doc-view-document->png doc-view-buffer-file-name png-file pages + 'doc-view-djvu->png-1))) (_ ;; Convert to PNG images. (doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) @@ -1186,7 +1244,7 @@ (image (if (and file (file-readable-p file)) (if (not (and doc-view-scale-internally (fboundp 'imagemagick-types))) - (apply 'create-image file 'png nil args) + (apply 'create-image file doc-view--image-type nil args) (unless (member :width args) (setq args `(,@args :width ,doc-view-image-width))) (apply 'create-image file 'imagemagick nil args)))) @@ -1236,13 +1294,17 @@ (let ((prev-pages doc-view-current-files)) (setq doc-view-current-files (sort (directory-files (doc-view-current-cache-dir) t - "page-[0-9]+\\.png" t) + (concat "page-[0-9]+\\." + doc-view--image-file-extension) + t) 'doc-view-sort)) (dolist (win (or (get-buffer-window-list buffer nil t) (list t))) (let* ((page (doc-view-current-page win)) - (pagefile (expand-file-name (format "page-%d.png" page) - (doc-view-current-cache-dir)))) + (pagefile (expand-file-name + (format "page-%d.%s" + page doc-view--image-file-extension) + (doc-view-current-cache-dir)))) (when (or force (and (not (member pagefile prev-pages)) (member pagefile doc-view-current-files))) @@ -1435,12 +1497,13 @@ ;; the conversion is incomplete. (file-readable-p (expand-file-name "resolution.el" (doc-view-current-cache-dir))) - (> (length (directory-files (doc-view-current-cache-dir) - nil "\\.png\\'")) + (> (length (directory-files + (doc-view-current-cache-dir) + nil (concat "\\." doc-view--image-file-extension "\\'"))) 0))) (defun doc-view-initiate-display () - ;; Switch to image display if possible + ;; Switch to image display if possible. (if (doc-view-mode-p doc-view-doc-type) (progn (doc-view-buffer-message) @@ -1509,6 +1572,8 @@ ("pdf" pdf) ("epdf" pdf) ;; PostScript ("ps" ps) ("eps" ps) + ;; DjVu + ("djvu" djvu) ;; OpenDocument formats ("odt" odf) ("ods" odf) ("odp" odf) ("odg" odf) ("odc" odf) ("odi" odf) ("odm" odf) ("ott" odf) @@ -1523,7 +1588,8 @@ (cond ((looking-at "%!") '(ps)) ((looking-at "%PDF") '(pdf)) - ((looking-at "\367\002") '(dvi)))))) + ((looking-at "\367\002") '(dvi)) + ((looking-at "AT&TFORM") '(djvu)))))) (set (make-local-variable 'doc-view-doc-type) (car (or (doc-view-intersection name-types content-types) (when (and name-types content-types) @@ -1532,6 +1598,16 @@ name-types content-types (error "Cannot determine the document type")))))) +(defun doc-view-set-up-single-converter () + "Find the right single-page converter for the current document type" + (pcase-let ((`(,conv-function ,type ,extension) + (pcase doc-view-doc-type + (`djvu (list #'doc-view-djvu->png-1 'tiff "tif")) + (_ (list #'doc-view-pdf->png-1 'png "png"))))) + (setq-local doc-view-single-page-converter-function conv-function) + (setq-local doc-view--image-type type) + (setq-local doc-view--image-file-extension extension))) + ;;;###autoload (defun doc-view-mode () "Major mode in DocView buffers. @@ -1564,6 +1640,7 @@ ;; Figure out the document type. (unless doc-view-doc-type (doc-view-set-doc-type)) + (doc-view-set-up-single-converter) (doc-view-make-safe-dir doc-view-cache-directory) ;; Handle compressed files, remote files, files inside archives ------------------------------------------------------------ revno: 111462 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13164 author: Elias Pipping committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-01-09 14:48:42 -0500 message: * lisp/doc-view.el: Add support for mupdf converter. (doc-view-pdfdraw-program, doc-view-pdf->png-converter-function) (doc-view-ps->png-converter-function): New config vars. (doc-view-pdf->png-converter-ghostscript) (doc-view-ps->png-converter-ghostscript) (doc-view-pdf->png-converter-mupdf): New functions. (doc-view-pdf/ps->png, doc-view-pdf->png-1): Use them. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-09 09:49:27 +0000 +++ lisp/ChangeLog 2013-01-09 19:48:42 +0000 @@ -1,3 +1,13 @@ +2013-01-09 Elias Pipping + + * doc-view.el: Add support for mupdf converter (bug#13164). + (doc-view-pdfdraw-program, doc-view-pdf->png-converter-function) + (doc-view-ps->png-converter-function): New config vars. + (doc-view-pdf->png-converter-ghostscript) + (doc-view-ps->png-converter-ghostscript) + (doc-view-pdf->png-converter-mupdf): New functions. + (doc-view-pdf/ps->png, doc-view-pdf->png-1): Use them. + 2013-01-09 Jürgen Hötzel * net/tramp.el (tramp-eshell-directory-change): Check remote-path === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2013-01-04 02:45:59 +0000 +++ lisp/doc-view.el 2013-01-09 19:48:42 +0000 @@ -158,6 +158,30 @@ :type 'file :group 'doc-view) +(defcustom doc-view-pdfdraw-program "mudraw" + "Program to convert PDF files to PNG." + :type 'file + :version "24.4") + +(defcustom doc-view-pdf->png-converter-function + 'doc-view-pdf->png-converter-ghostscript + "Function to call to convert a PDF file into a PNG file." + :type '(radio + (function-item doc-view-pdf->png-converter-ghostscript + :doc "Use ghostscript") + (function-item doc-view-pdf->png-converter-mupdf + :doc "Use mupdf") + function) + :version "24.4") + +(defcustom doc-view-ps->png-converter-function + 'doc-view-ps->png-converter-ghostscript + "Function to call to convert a PS file into a PNG file." + :type '(radio (function-item doc-view-ps->png-converter-ghostscript + :doc "Use ghostscript") + function) + :version "24.4") + (defcustom doc-view-ghostscript-options '("-dSAFER" ;; Avoid security problems when rendering files from untrusted ;; sources. @@ -661,6 +685,7 @@ (executable-find doc-view-dvipdfm-program))))) ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps) (eq type 'pdf)) + ;; FIXME: allow mupdf here (and doc-view-ghostscript-program (executable-find doc-view-ghostscript-program))) ((eq type 'odf) @@ -826,6 +851,25 @@ (list "-o" pdf dvi) callback))) +(defun doc-view-pdf->png-converter-ghostscript (resolution pdf png &optional page) + `((command . ,doc-view-ghostscript-program) + (arguments . (,@doc-view-ghostscript-options + ,(format "-r%d" resolution) + ,@(if page `(,(format "-dFirstPage=%d" page))) + ,@(if page `(,(format "-dLastPage=%d" page))) + ,(concat "-sOutputFile=" png) + ,pdf)))) + +(defalias 'doc-view-ps->png-converter-ghostscript + 'doc-view-pdf->png-converter-ghostscript) + +(defun doc-view-pdf->png-converter-mupdf (resolution pdf png &optional page) + `((command . ,doc-view-pdfdraw-program) + (arguments . (,(concat "-o" png) + ,(format "-r%d" resolution) + ,pdf + ,@(if page `(,(format "%d" page))))))) + (defun doc-view-odf->pdf (odf callback) "Convert ODF to PDF asynchronously and call CALLBACK when finished. The converted PDF is put into the current cache directory, and it @@ -836,12 +880,15 @@ (defun doc-view-pdf/ps->png (pdf-ps png) "Convert PDF-PS to PNG asynchronously." - (doc-view-start-process - "pdf/ps->png" doc-view-ghostscript-program - (append doc-view-ghostscript-options - (list (format "-r%d" (round doc-view-resolution)) - (concat "-sOutputFile=" png) - pdf-ps)) + (let ((invocation + (pcase doc-view-doc-type + (`pdf (funcall doc-view-pdf->png-converter-function + (round doc-view-resolution) pdf-ps png)) + (_ (funcall doc-view-ps->png-converter-function + (round doc-view-resolution) pdf-ps png))))) + (doc-view-start-process + "pdf/ps->png" (cdr (assoc 'command invocation)) + (cdr (assoc 'arguments invocation)) (let ((resolution doc-view-resolution)) (lambda () ;; Only create the resolution file when it's all done, so it also @@ -853,7 +900,7 @@ (when doc-view-current-timer (cancel-timer doc-view-current-timer) (setq doc-view-current-timer nil)) - (doc-view-display (current-buffer) 'force)))) + (doc-view-display (current-buffer) 'force))))) ;; Update the displayed pages as soon as they're done generating. (when doc-view-conversion-refresh-interval (setq doc-view-current-timer @@ -864,17 +911,12 @@ (defun doc-view-pdf->png-1 (pdf png page callback) "Convert a PAGE of a PDF file to PNG asynchronously. Call CALLBACK with no arguments when done." - (doc-view-start-process - "pdf->png-1" doc-view-ghostscript-program - (append doc-view-ghostscript-options - (list (format "-r%d" (round doc-view-resolution)) - ;; Sadly, `gs' only supports the page-range - ;; for PDF files. - (format "-dFirstPage=%d" page) - (format "-dLastPage=%d" page) - (concat "-sOutputFile=" png) - pdf)) - callback)) + (let ((invocation (funcall doc-view-pdf->png-converter-function + (round doc-view-resolution) pdf png page))) + (doc-view-start-process + "pdf/ps->png" (cdr (assoc 'command invocation)) + (cdr (assoc 'arguments invocation)) + callback))) (declare-function clear-image-cache "image.c" (&optional filter)) ------------------------------------------------------------ revno: 111461 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2013-01-09 16:07:44 +0100 message: nt/config.nt: Sync with autogen/config.in. (HAVE_GTK_HANDLE_BOX_NEW, HAVE_GTK_TEAROFF_MENU_ITEM_NEW): New macros. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-01-02 16:13:04 +0000 +++ nt/ChangeLog 2013-01-09 15:07:44 +0000 @@ -1,3 +1,8 @@ +2013-01-09 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (HAVE_GTK_HANDLE_BOX_NEW, HAVE_GTK_TEAROFF_MENU_ITEM_NEW): New macros. + 2012-12-24 Eli Zaretskii * inc/sys/stat.h (S_ISMPX): Define to zero, to accommodate changes === modified file 'nt/config.nt' --- nt/config.nt 2013-01-03 02:37:57 +0000 +++ nt/config.nt 2013-01-09 15:07:44 +0000 @@ -485,12 +485,18 @@ /* Define to 1 if you have the `gtk_file_selection_new' function. */ #undef HAVE_GTK_FILE_SELECTION_NEW +/* Define to 1 if you have the `gtk_handle_box_new' function. */ +#undef HAVE_GTK_HANDLE_BOX_NEW + /* Define to 1 if you have the `gtk_main' function. */ #undef HAVE_GTK_MAIN /* Define to 1 if you have the `gtk_orientable_set_orientation' function. */ #undef HAVE_GTK_ORIENTABLE_SET_ORIENTATION +/* Define to 1 if you have the `gtk_tearoff_menu_item_new' function. */ +#undef HAVE_GTK_TEAROFF_MENU_ITEM_NEW + /* Define to 1 if you have the `gtk_widget_get_mapped' function. */ #undef HAVE_GTK_WIDGET_GET_MAPPED ------------------------------------------------------------ revno: 111460 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2013-01-09 16:07:01 +0100 message: src/w32.c, src/w32term.c: Remove unused local variables. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-09 14:08:49 +0000 +++ src/ChangeLog 2013-01-09 15:07:01 +0000 @@ -1,3 +1,8 @@ +2013-01-09 Juanma Barranquero + + * w32.c (get_name_and_id, acl_set_file): + * w32term.c (w32fullscreen_hook): Remove unused local variables. + 2013-01-09 Dmitry Antipov * lisp.h (make_gap_1): New prototype. === modified file 'src/w32.c' --- src/w32.c 2013-01-02 16:13:04 +0000 +++ src/w32.c 2013-01-09 15:07:01 +0000 @@ -3648,7 +3648,6 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, unsigned *id, char *nm, int what) { PSID sid = NULL; - char machine[MAX_COMPUTERNAME_LENGTH+1]; BOOL dflt; SID_NAME_USE ignore; char name[UNLEN+1]; @@ -4800,7 +4799,6 @@ { TOKEN_PRIVILEGES old1, old2; DWORD err; - BOOL res; int st = 0, retval = -1; SECURITY_INFORMATION flags = 0; PSID psid; === modified file 'src/w32term.c' --- src/w32term.c 2013-01-04 19:22:37 +0000 +++ src/w32term.c 2013-01-09 15:07:01 +0000 @@ -5652,7 +5652,7 @@ static void w32fullscreen_hook (FRAME_PTR f) { - static int normal_width, normal_height, normal_top, normal_left; + static int normal_width, normal_height; if (f->async_visible) { ------------------------------------------------------------ revno: 111459 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-01-09 18:08:49 +0400 message: * insdel.c (make_gap_larger): Fix comment because gap_left doesn't adjust markers. (make_gap_smaller): Likewise for gap_right. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-09 13:50:22 +0000 +++ src/ChangeLog 2013-01-09 14:08:49 +0000 @@ -6,7 +6,7 @@ * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common naming convention. (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code. - * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. + * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment. (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment. (make_gap_1): New function to adjust the gap of any buffer. * coding.c (coding_alloc_by_making_gap): Use it. === modified file 'src/insdel.c' --- src/insdel.c 2013-01-09 13:50:22 +0000 +++ src/insdel.c 2013-01-09 14:08:49 +0000 @@ -412,8 +412,7 @@ GPT_BYTE = Z_BYTE + GAP_SIZE; GAP_SIZE = nbytes_added; - /* Move the new gap down to be consecutive with the end of the old one. - This adjusts the markers properly too. */ + /* Move the new gap down to be consecutive with the end of the old one. */ gap_left (real_gap_loc + old_gap_size, real_gap_loc_byte + old_gap_size, 1); /* Now combine the two into one large gap. */ @@ -467,8 +466,7 @@ Z_BYTE += new_gap_size; GAP_SIZE = nbytes_removed; - /* Move the unwanted pretend gap to the end of the buffer. This - adjusts the markers properly too. */ + /* Move the unwanted pretend gap to the end of the buffer. */ gap_right (Z, Z_BYTE); enlarge_buffer_text (current_buffer, -nbytes_removed); ------------------------------------------------------------ revno: 111458 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-01-09 17:50:22 +0400 message: * lisp.h (make_gap_1): New prototype. * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special gap size values. * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common naming convention. (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code. * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment. (make_gap_1): New function to adjust the gap of any buffer. * coding.c (coding_alloc_by_making_gap): Use it. * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE, GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-08 23:50:40 +0000 +++ src/ChangeLog 2013-01-09 13:50:22 +0000 @@ -1,3 +1,18 @@ +2013-01-09 Dmitry Antipov + + * lisp.h (make_gap_1): New prototype. + * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special + gap size values. + * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common + naming convention. + (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code. + * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. + (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment. + (make_gap_1): New function to adjust the gap of any buffer. + * coding.c (coding_alloc_by_making_gap): Use it. + * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE, + GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment. + 2013-01-08 Juri Linkov * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case === modified file 'src/buffer.c' --- src/buffer.c 2013-01-02 16:13:04 +0000 +++ src/buffer.c 2013-01-09 13:50:22 +0000 @@ -1682,17 +1682,13 @@ if (!buffer->text->inhibit_shrinking) { /* If a buffer's gap size is more than 10% of the buffer - size, or larger than 2000 bytes, then shrink it - accordingly. Keep a minimum size of 20 bytes. */ - int size = min (2000, max (20, (buffer->text->z_byte / 10))); - - if (buffer->text->gap_size > size) - { - struct buffer *save_current = current_buffer; - current_buffer = buffer; - make_gap (-(buffer->text->gap_size - size)); - current_buffer = save_current; - } + size, or larger than GAP_BYTES_DFL bytes, then shrink it + accordingly. Keep a minimum size of GAP_BYTES_MIN bytes. */ + ptrdiff_t size = clip_to_bounds (GAP_BYTES_MIN, + BUF_Z_BYTE (buffer) / 10, + GAP_BYTES_DFL); + if (BUF_GAP_SIZE (buffer) > size) + make_gap_1 (buffer, -(BUF_GAP_SIZE (buffer) - size)); } BUF_COMPACT (buffer) = BUF_MODIFF (buffer); } === modified file 'src/buffer.h' --- src/buffer.h 2013-01-02 16:13:04 +0000 +++ src/buffer.h 2013-01-09 13:50:22 +0000 @@ -320,6 +320,16 @@ #define BUF_BYTES_MAX \ (ptrdiff_t) min (MOST_POSITIVE_FIXNUM - 1, min (SIZE_MAX, PTRDIFF_MAX)) +/* Maximum gap size after compact_buffer, in bytes. Also + used in make_gap_larger to get some extra reserved space. */ + +#define GAP_BYTES_DFL 2000 + +/* Minimum gap size after compact_buffer, in bytes. Also + used in make_gap_smaller to avoid too small gap size. */ + +#define GAP_BYTES_MIN 20 + /* Return the address of byte position N in current buffer. */ #define BYTE_POS_ADDR(n) \ === modified file 'src/coding.c' --- src/coding.c 2013-01-02 16:13:04 +0000 +++ src/coding.c 2013-01-09 13:50:22 +0000 @@ -1049,14 +1049,7 @@ GPT -= gap_head_used, GPT_BYTE -= gap_head_used; } else - { - Lisp_Object this_buffer; - - this_buffer = Fcurrent_buffer (); - set_buffer_internal (XBUFFER (coding->dst_object)); - make_gap (bytes); - set_buffer_internal (XBUFFER (this_buffer)); - } + make_gap_1 (XBUFFER (coding->dst_object), bytes); } === modified file 'src/editfns.c' --- src/editfns.c 2013-01-02 16:13:04 +0000 +++ src/editfns.c 2013-01-09 13:50:22 +0000 @@ -968,7 +968,7 @@ return unbind_to (count, Fprogn (args)); } -DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, +DEFUN ("buffer-size", Fbuffer_size, Sbuffer_size, 0, 1, 0, doc: /* Return the number of characters in the current buffer. If BUFFER, return the number of characters in that buffer instead. */) (Lisp_Object buffer) @@ -4883,12 +4883,10 @@ defsubr (&Sline_beginning_position); defsubr (&Sline_end_position); -/* defsubr (&Smark); */ -/* defsubr (&Sset_mark); */ defsubr (&Ssave_excursion); defsubr (&Ssave_current_buffer); - defsubr (&Sbufsize); + defsubr (&Sbuffer_size); defsubr (&Spoint_max); defsubr (&Spoint_min); defsubr (&Spoint_min_marker); === modified file 'src/insdel.c' --- src/insdel.c 2013-01-02 16:13:04 +0000 +++ src/insdel.c 2013-01-09 13:50:22 +0000 @@ -388,14 +388,13 @@ ptrdiff_t real_gap_loc_byte; ptrdiff_t old_gap_size; ptrdiff_t current_size = Z_BYTE - BEG_BYTE + GAP_SIZE; - enum { enough_for_a_while = 2000 }; if (BUF_BYTES_MAX - current_size < nbytes_added) buffer_overflow (); /* If we have to get more space, get enough to last a while; but do not exceed the maximum buffer size. */ - nbytes_added = min (nbytes_added + enough_for_a_while, + nbytes_added = min (nbytes_added + GAP_BYTES_DFL, BUF_BYTES_MAX - current_size); enlarge_buffer_text (current_buffer, nbytes_added); @@ -443,9 +442,9 @@ ptrdiff_t real_beg_unchanged; ptrdiff_t new_gap_size; - /* Make sure the gap is at least 20 bytes. */ - if (GAP_SIZE - nbytes_removed < 20) - nbytes_removed = GAP_SIZE - 20; + /* Make sure the gap is at least GAP_BYTES_MIN bytes. */ + if (GAP_SIZE - nbytes_removed < GAP_BYTES_MIN) + nbytes_removed = GAP_SIZE - GAP_BYTES_MIN; /* Prevent quitting in move_gap. */ tem = Vinhibit_quit; @@ -500,7 +499,20 @@ make_gap_smaller (-nbytes_added); #endif } - + +/* Add NBYTES to B's gap. It's enough to temporarily + fake current_buffer and avoid real switch to B. */ + +void +make_gap_1 (struct buffer *b, ptrdiff_t nbytes) +{ + struct buffer *oldb = current_buffer; + + current_buffer = b; + make_gap (nbytes); + current_buffer = oldb; +} + /* Copy NBYTES bytes of text from FROM_ADDR to TO_ADDR. FROM_MULTIBYTE says whether the incoming text is multibyte. TO_MULTIBYTE says whether to store the text as multibyte. === modified file 'src/lisp.h' --- src/lisp.h 2013-01-02 16:13:04 +0000 +++ src/lisp.h 2013-01-09 13:50:22 +0000 @@ -2778,6 +2778,7 @@ extern void move_gap_both (ptrdiff_t, ptrdiff_t); extern _Noreturn void buffer_overflow (void); extern void make_gap (ptrdiff_t); +extern void make_gap_1 (struct buffer *, ptrdiff_t); extern ptrdiff_t copy_text (const unsigned char *, unsigned char *, ptrdiff_t, bool, bool); extern int count_combining_before (const unsigned char *, ------------------------------------------------------------ revno: 111457 committer: Michael Albinus + + * net/tramp.el (tramp-eshell-directory-change): Check remote-path + first in session cache: When `tramp-own-remote-path' is in + `tramp-remote-path', the remote path is only set in the session + cache. + 2013-01-09 Glenn Morris * emacs-lisp/trace.el (trace-function-foreground) === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2013-01-08 04:40:09 +0000 +++ lisp/net/tramp.el 2013-01-09 09:49:27 +0000 @@ -3901,7 +3901,12 @@ (with-parsed-tramp-file-name default-directory nil (mapconcat 'identity - (tramp-get-connection-property v "remote-path" nil) + (or + ;; When `tramp-own-remote-path' is in `tramp-remote-path', + ;; the remote path is only set in the session cache. + (tramp-get-connection-property + (tramp-get-connection-process v) "remote-path" nil) + (tramp-get-connection-property v "remote-path" nil)) ":")) (getenv "PATH")))) ------------------------------------------------------------ revno: 111456 [merge] committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-01-09 00:30:21 -0800 message: Merge from emacs-24; up to r111157 diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-01-08 00:11:51 +0000 +++ doc/misc/ChangeLog 2013-01-09 08:30:21 +0000 @@ -1,3 +1,18 @@ +2013-01-09 Bastien Guerry + + * org.texi (Pushing to MobileOrg): Add footnote about using + symbolic links in `org-directory'. + (Timestamps, Deadlines and scheduling): Use `diary-float' instead + of the now obsolete alias `org-float'. + (TODO basics): Add `org-use-fast-todo-selection' to the variable + index. Fix description of TODO keywords cycling. + (Advanced features): Add missing argument for @item. + (Storing searches): Add index entries and a note about + *-tree agenda views. + (Structure editing): Document `org-mark-element' and + `org-mark-subtree'. + (Tag inheritance): Document `org-agenda-use-tag-inheritance'. + 2013-01-08 Juri Linkov * info.texi (Go to node): Mention the abbreviated format === modified file 'doc/misc/org.texi' --- doc/misc/org.texi 2013-01-06 20:34:54 +0000 +++ doc/misc/org.texi 2013-01-09 08:30:21 +0000 @@ -2,7 +2,7 @@ @c %**start of header @setfilename ../../info/org @settitle The Org Manual -@set VERSION 7.9.2 (GNU Emacs 24.3) +@set VERSION 7.9.3+ (GNU Emacs 24.3) @c Use proper quote and backtick for code sections in PDF output @c Cf. Texinfo manual 14.2 @@ -1470,6 +1470,13 @@ level). @orgcmd{M-S-@key{down},org-move-subtree-down} Move subtree down (swap with next subtree of same level). +@orgcmd{M-h,org-mark-element} +Mark the element at point. Hitting repeatedly will mark subsequent elements +of the one just marked. E.g. hitting @key{M-h} on a paragraph will mark it, +hitting @key{M-h} immediately again will mark the next one. +@orgcmd{C-c @@,org-mark-subtree} +Mark the subtree at point. Hitting repeatedly will mark subsequent subtrees +of the same level than the marked subtree. @orgcmd{C-c C-x C-w,org-cut-subtree} Kill subtree, i.e., remove it from buffer but save in kill ring. With a numeric prefix argument N, kill N sequential subtrees. @@ -3747,6 +3754,8 @@ @table @kbd @orgcmd{C-c C-t,org-todo} @cindex cycling, of TODO states +@vindex org-use-fast-todo-selection + Rotate the TODO state of the current item among @example @@ -3754,14 +3763,19 @@ '--------------------------------' @end example -The same rotation can also be done ``remotely'' from the timeline and -agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}). +If TODO keywords have fast access keys (see @ref{Fast access to TODO +states}), you will be prompted for a TODO keyword through the fast selection +interface; this is the default behavior when +@var{org-use-fast-todo-selection} is @code{non-nil}. + +The same rotation can also be done ``remotely'' from the timeline and agenda +buffers with the @kbd{t} command key (@pxref{Agenda commands}). @orgkey{C-u C-c C-t} -Select a specific keyword using completion or (if it has been set up) -the fast selection interface. For the latter, you need to assign keys -to TODO states, see @ref{Per-file keywords}, and @ref{Setting tags}, for -more information. +When TODO keywords have no selection keys, select a specific keyword using +completion; otherwise force cycling through TODO states with no prompt. When +@var{org-use-fast-todo-selection} is set to @code{prefix}, use the fast +selection interface. @kindex S-@key{right} @kindex S-@key{left} @@ -4617,9 +4631,8 @@ @noindent @vindex org-use-tag-inheritance @vindex org-tags-exclude-from-inheritance -To limit tag inheritance to specific tags, or to turn it off entirely, use -the variables @code{org-use-tag-inheritance} and -@code{org-tags-exclude-from-inheritance}. +To limit tag inheritance to specific tags, use @code{org-tags-exclude-from-inheritance}. +To turn it off entirely, use @code{org-use-tag-inheritance}. @vindex org-tags-match-list-sublevels When a headline matches during a tags search while tag inheritance is turned @@ -4630,6 +4643,15 @@ match in a subtree, configure the variable @code{org-tags-match-list-sublevels} (not recommended). +@vindex org-agenda-use-tag-inheritance +Tag inheritance is relevant when the agenda search tries to match a tag, +either in the @code{tags} or @code{tags-todo} agenda types. In other agenda +types, @code{org-use-tag-inheritance} has no effect. Still, you may want to +have your tags correctly set in the agenda, so that tag filtering works fine, +with inherited tags. Set @code{org-agenda-use-tag-inheritance} to control +this: the default value includes all agenda types, but setting this to nil +can really speed up agenda generation. + @node Setting tags, Tag searches, Tag inheritance, Tags @section Setting tags @cindex setting tags @@ -5512,7 +5534,7 @@ @example * 22:00-23:00 The nerd meeting on every 2nd Thursday of the month - <%%(org-float t 4 2)> + <%%(diary-float t 4 2)> @end example @item Time/Date range @@ -5850,7 +5872,7 @@ assumption that the timestamp represents the @i{nearest instance} of the repeater. However, the use of diary sexp entries like @c -@code{<%%(org-float t 42)>} +@code{<%%(diary-float t 42)>} @c in scheduling and deadline timestamps is limited. Org mode does not know enough about the internals of each sexp function to issue early and @@ -6539,7 +6561,7 @@ @table @kbd @orgcmd{C-c c,org-capture} Call the command @code{org-capture}. Note that this keybinding is global and -not active by default; you need to install it. If you have templates +not active by default: you need to install it. If you have templates @cindex date tree defined @pxref{Capture templates}, it will offer these templates for selection or use a new Org outline node as the default template. It will @@ -8621,6 +8643,13 @@ buffer). @kindex C-c a C @vindex org-agenda-custom-commands +@cindex agenda views, main example +@cindex tags, as an agenda view +@cindex todo, as an agenda view +@cindex tags-todo +@cindex todo-tree +@cindex occur-tree +@cindex tags-tree Custom commands are configured in the variable @code{org-agenda-custom-commands}. You can customize this variable, for @@ -8681,6 +8710,9 @@ Peter, or Kim) as additional tag to match. @end table +Note that the @code{*-tree} agenda views need to be called from an +Org buffer as they operate on the current buffer only. + @node Block agenda, Setting Options, Storing searches, Custom agenda views @subsection Block agenda @cindex block agenda @@ -16537,14 +16569,18 @@ all agenda files (as listed in @code{org-agenda-files}), but additional files can be included by customizing @code{org-mobile-files}. File names will be staged with paths relative to @code{org-directory}, so all files should be -inside this directory. The push operation also creates a special Org file -@file{agendas.org} with all custom agenda view defined by the -user@footnote{While creating the agendas, Org mode will force ID properties -on all referenced entries, so that these entries can be uniquely identified -if @i{MobileOrg} flags them for further action. If you do not want to get -these properties in so many entries, you can set the variable -@code{org-mobile-force-id-on-agenda-items} to @code{nil}. Org mode will then -rely on outline paths, in the hope that these will be unique enough.}. +inside this directory@footnote{Symbolic links in @code{org-directory} need to +have the same name than their targets.}. + +The push operation also creates a special Org file @file{agendas.org} with +all custom agenda view defined by the user@footnote{While creating the +agendas, Org mode will force ID properties on all referenced entries, so that +these entries can be uniquely identified if @i{MobileOrg} flags them for +further action. If you do not want to get these properties in so many +entries, you can set the variable @code{org-mobile-force-id-on-agenda-items} +to @code{nil}. Org mode will then rely on outline paths, in the hope that +these will be unique enough.}. + Finally, Org writes the file @file{index.org}, containing links to all other files. @i{MobileOrg} first reads this file from the server, and then downloads all agendas and Org files listed in it. To speed up the download, === modified file 'etc/ORG-NEWS' --- etc/ORG-NEWS 2013-01-01 09:11:05 +0000 +++ etc/ORG-NEWS 2013-01-08 22:02:09 +0000 @@ -1,10 +1,54 @@ ORG NEWS -- history of user-visible changes. -*- org -*- +#+LINK: doc http://orgmode.org/worg/doc.html#%s + Copyright (C) 2012-2013 Free Software Foundation, Inc. See the end of the file for license conditions. Please send Org bug reports to emacs-orgmode@gnu.org. +* Version 7.9.3 + +** New option [[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]] + +[[doc::org-use-tag-inheritance][org-use-tag-inheritance]] controls whether tags are inherited when +org-tags-view is called (either in =tags=, =tags-tree= or =tags-todo= +agenda views.) + +When generating other agenda types such as =agenda=, =todo= and +=todo-tree=, tags inheritance is not used when selecting the entries +to display. Still, you might want to have all tag information correct +in the agenda buffer, e.g. for tag filtering. In that case, add the +agenda type to this variable. + +Setting this variable to nil should considerably speeds up the agenda +generation. + +Note that the default was to display inherited tags in the agenda +lines even if `org-use-tag-inheritance' was nil. The default is now +to *never* display inherited tags in agenda lines, but to /know/ about +them when the agenda type is listed in [[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]]. + +** New default value nil for [[doc::org-agenda-dim-blocked-tasks][org-agenda-dim-blocked-tasks]] + +Using `nil' as the default value speeds up the agenda generation. You +can hit `#' (or `C-u #') in agenda buffers to temporarily dim (or turn +invisible) blocked tasks. + +** New speedy keys for [[doc::org-speed-commands-default][org-speed-commands-default]] + +You can now use `:' (instead of `;') for setting tags---this is +consistent with using the `:' key in agenda view. + +You can now use `=' for [[doc::org-columns][org-columns]]. + +** =org-float= is now obsolete, use =diary-float= instead +** Enhanced compatibility with Emacs 22 and XEmacs + +Thanks to Achim for his work on enhancing Org's compatibility with +various Emacsen. Things may not be perfect, but Org should work okay +in most environments. + * Version 7.9.2 ** New ELPA repository for Org packages === modified file 'etc/refcards/orgcard.pdf' Binary files etc/refcards/orgcard.pdf 2013-01-03 02:11:33 +0000 and etc/refcards/orgcard.pdf 2013-01-08 14:27:18 +0000 differ === modified file 'etc/refcards/orgcard.tex' --- etc/refcards/orgcard.tex 2013-01-01 09:11:05 +0000 +++ etc/refcards/orgcard.tex 2013-01-08 22:02:09 +0000 @@ -1,6 +1,6 @@ % Reference Card for Org Mode -\def\orgversionnumber{7.9.2} -\def\versionyear{2012} % latest update +\def\orgversionnumber{7.9.3} +\def\versionyear{2013} % latest update \input emacsver.tex %**start of header === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-09 08:17:47 +0000 +++ lisp/ChangeLog 2013-01-09 08:30:21 +0000 @@ -1,3 +1,27 @@ +2013-01-09 Glenn Morris + + * emacs-lisp/trace.el (trace-function-foreground) + (trace-function-background): Doc fix. + +2013-01-09 Juri Linkov + + * international/mule-cmds.el (read-char-by-name): Move let-binding + of completion-ignore-case around completing-read to fix regression + exhibited by the test case `C-x 8 RET *acc TAB' and caused by + `string-match-p' using the nil value of `case-fold-search' and + `completion-ignore-case' in `completion-pcm--all-completions'. + (Bug#12615). + +2013-01-09 Glenn Morris + + * progmodes/compile.el (compilation-parse-errors): + Fix typo. (Bug#13369) + +2013-01-09 Vitalie Spinu (tiny change) + + * comint.el (comint-send-input): Check size of buffer before + waiting for process output, in case already accepted. (Bug#13290) + 2013-01-09 Paul Eggert Spelling fixes. === modified file 'lisp/comint.el' --- lisp/comint.el 2013-01-02 16:13:04 +0000 +++ lisp/comint.el 2013-01-09 08:30:21 +0000 @@ -1847,9 +1847,9 @@ (let ((echo-len (- comint-last-input-end comint-last-input-start))) ;; Wait for all input to be echoed: - (while (and (accept-process-output proc) - (> (+ comint-last-input-end echo-len) + (while (and (> (+ comint-last-input-end echo-len) (point-max)) + (accept-process-output proc) (zerop (compare-buffer-substrings nil comint-last-input-start === modified file 'lisp/emacs-lisp/trace.el' --- lisp/emacs-lisp/trace.el 2013-01-09 04:01:57 +0000 +++ lisp/emacs-lisp/trace.el 2013-01-09 08:30:21 +0000 @@ -266,7 +266,9 @@ trace advice for FUNCTION and activates it together with any other advice there might be!! The trace BUFFER will popup whenever FUNCTION is called. Do not use this to trace functions that switch buffers or do any other -display oriented stuff, use `trace-function-background' instead." +display oriented stuff, use `trace-function-background' instead. + +To untrace a function, use `untrace-function' or `untrace-all'." (interactive (trace--read-args "Trace function: ")) (trace-function-internal function buffer nil context)) @@ -280,7 +282,9 @@ The trace output goes to BUFFER quietly, without changing the window or buffer configuration. -BUFFER defaults to `trace-buffer'." +BUFFER defaults to `trace-buffer'. + +To untrace a function, use `untrace-function' or `untrace-all'." (interactive (trace--read-args "Trace function in background: ")) (trace-function-internal function buffer t context)) === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2013-01-02 16:13:04 +0000 +++ lisp/international/mule-cmds.el 2013-01-09 08:30:21 +0000 @@ -2946,14 +2946,14 @@ point or a number in hash notation, e.g. #o21430 for octal, #x2318 for hex, or #10r8984 for decimal." (let* ((enable-recursive-minibuffers t) + (completion-ignore-case t) (input (completing-read prompt (lambda (string pred action) - (let ((completion-ignore-case t)) - (if (eq action 'metadata) - '(metadata (category . unicode-name)) - (complete-with-action action (ucs-names) string pred)))))) + (if (eq action 'metadata) + '(metadata (category . unicode-name)) + (complete-with-action action (ucs-names) string pred))))) (char (cond ((string-match-p "\\`[0-9a-fA-F]+\\'" input) === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2013-01-02 16:13:04 +0000 +++ lisp/org/ChangeLog 2013-01-09 08:30:21 +0000 @@ -1,3 +1,357 @@ +2013-01-09 Achim Gratz + + * org-compat.el (org-define-obsolete-function-alias) + (org-define-obsolete-variable-alias): Introduce new compatibility + macros to obsolete functions and variables. + + * org-agenda.el, org-clock.el, org-id.el, org-lparse.el: + * org-protocol.el, org.el: + Use `org-define-obsolete-{function,variable}-alias' instead + of `define-obsolate{function,variable}-alias'. + + * org-faces.el: Define face alias mode-line for XEmacs (it's + called modeline there). + + * org-compat.el (org-condition-case-unless-debug): Do not use + defalias for special forms, the Emacs 22 byte-compiler does not + recognize them correctly when compiling macros. Use a macro + instead and rely on macro expansion. That however makes the + decision at compile time, which should be acceptable in this case + since it only affects debugging. + + * org-compat.el (org-no-popups): New wrapper macro which let-binds + the correct variables to suppress popup windows depending on the + Emacs version in use. This is a compile-time decision when + byte-compiling. + + * org.el (org-get-location, org-switch-to-buffer-other-window): + Use the wrapper `org-no-popups' to let-bind the correct variables + for suppression of popup windows. + + * org-compat.el (user-error): Defalias to `error' for Emacsen that + don't have it. + + * org-agenda.el (org-agenda-write): Use org-called-interactively-p + instead of called-interactively-p. + + * org.el (org-find-invisible-foreground): Do not use the value of + variables `default-frame-alist', `initial-frame-alist' and + `window-system-default-frame-alist' when their symbol is not bound. + +2013-01-09 Bastien Guerry + + * org-src.el (org-edit-src-code): Fix bug when trying to edit a + table.el table. + + * org-agenda.el (org-agenda-finalize): Inhibit readonly for the + whole function. + + * org.el (org-entry-get): Speed up by let-binding some variables + only if needed. Also fix a bug: consider an empty drawer as no drawer. + + * org-agenda.el (org-search-view, org-agenda-get-todos) + (org-agenda-get-timestamps, org-agenda-get-sexps) + (org-agenda-get-progress, org-agenda-get-deadlines) + (org-agenda-get-scheduled, org-agenda-get-blocks) + (org-agenda-change-all-lines): Get local tags only. + (org-agenda-use-tag-inheritance): New option. + (org-agenda-finalize): When `org-agenda-use-tag-inheritance' + is non-nil, possibly reset tags in the agenda buffer. + (org-agenda-check-type): Enhance docstring. + + * org.el (org-use-tag-inheritance): Fix typo in docstring. + + * org-agenda.el (org-float): Don't alias `org-float'. + + * org.el (org-scan-tags): The skipper already checks for archived + entries. + + * org.el (org-refresh-properties): Rename from + `org-refresh-effort-properties' and use two new parameters. + (org-agenda-prepare-buffers): Use `org-refresh-properties'. + Also refresh the 'org-appt-warntime text property. + + * org-clock.el (org-clock-in): Use the renamed defun. + + * org-icalendar.el (org-icalendar-print-entries): + Refresh the 'org-appt-warntime property. + (org-icalendar-print-entries): + * org-agenda.el (org-agenda-get-timestamps) + (org-agenda-get-sexps, org-agenda-get-deadlines) + (org-agenda-get-scheduled): Do not use `org-entry-get' to get the + "APPT_WARNTIME" property value. + + * org.el (org-id-link-to-org-use-id): Fix compiler warning. + + * org-agenda.el (org-agenda-format-item): Do not use + `org-get-effort' to get the effort text property. + (org-agenda-get-sexps): Use `org-back-to-heading' when setting tags. + + * org-clock.el (org-clock-in): Refresh effort properties. + + * org.el (org-refresh-effort-properties): New defun. + (org-get-effort): Delete. + (org-set-effort): + (org-property-next-allowed-value): Set the 'org-effort text property. + (org-agenda-prepare-buffers): Refresh effort properties. + + * org.el (org-read-date): Let-bind `mouse-autoselect-window' to + nil so that the mouse doesn't jump when the option is set to t globally. + + * org-agenda.el (org-agenda-dim-blocked-tasks): Default to nil. + (org-agenda-dim-blocked-tasks): Make interactive and allow an + optional parameter 'invisible to hide blocked tasks instead of + just dimming them. + (org-agenda-mode-map): Bind `org-agenda-dim-blocked-tasks' to "#". + + * org-agenda.el (org-agenda-finalize): Don't try to align tags + when there are no tags. Only try to draw the habit consistency + graph when there is a habit in the buffer. Only mark clocking + task when there is one. + + * org.el (org-adaptive-fill-function): DTRT in `message-mode'. + + * org.el (org-get-priority): Save match data even when using + `org-get-priority-function'. + + * org-mobile.el (org-mobile-create-index-file): + Possibly normalize `org-todo-keywords'. + + * org-mobile.el (org-mobile-push): Use the correct agenda buffer names. + + * org.el (org-store-link): Use `org-id-link-to-org-use-id' instead + of the obsolete variable name. + + * org.el (org-fontify-meta-lines-and-blocks-1): + Fix bug when fontifying keywords with no value. + + * org.el (org-goto-auto-isearch): Enhance docstring. + (org-goto-map): Make a defun, so that the customized value of + org-goto-auto-isearch is correctly initialized. + (org-goto): Initialize the keymap with `org-goto-map'. + (org-get-location): Use *Org Help* as a temporary buffer. + Tell whether auto-isearch is on or off. + + * org-exp.el (org-export-as-org): Remove useless argument. + + * org-docbook.el (org-export-as-docbook-batch) + (org-export-region-as-docbook, org-export-as-docbook-pdf): + Fix the number of arguments. + (org-export-as-docbook): Remove useless argument. + + * org.el (org-speed-commands-default): Use ":" instead of ";" for + `org-set-tags-command', which is consistent with ":" in agenda + view. Use "=" for `org-columns". + + * org.el (org-sparse-tree): Fix redundant information in prompt. + + * org-exp.el (org-export-string): Fix number of arguments passed + to the org-export-as-* functions. + + * org-latex.el (org-export-as-latex): Fix typo in docstring. + + * org-list.el (org-cycle-include-plain-lists): Docstring enhancement. + + * org.el (org-fontify-meta-lines-and-blocks-1): Fix fontification + bug when fontifying a keyword with no associated value. + (org-cycle-internal-local): Don't run hooks when cycling a plain + list before first headline. + (org-ctrl-c-ctrl-c): Throw a user error when trying to toggle a + blocked checkbox. + (org-indent-line): Fix table formulas indenting. + + * org-agenda.el (org-agenda-open-link): Fix bug when no link is + matched. Return a message instead of an error. + (org-agenda-priority): Remove useless parameter and fix showing + priority in agenda buffers. + + * org-macs.el (org-with-buffer-modified-unmodified): New macro. + + * org.el (org-entry-blocked-p): Use the new macro. + + * org-src.el (org-edit-src-exit): Don't comma-escape the content + of a fixed width region. + + * org.el (org-blocker-hook): Update the docstring to mention that + functions in this hook should not modify the buffer. + (org-trigger-hook): Small docstring fix. + (org-entry-blocked-p): Use `with-buffer-modified-unmodified' + so that the function never modifies the buffer. + + * org-agenda.el (org-agenda-open-link): Allow to open an internal + link by using the new `org-offer-links-in-entry' function. + + * org.el (org-offer-links-in-entry): Do not open the link directly + through `org-open-link-from-string', only offer to select a link + and return a cons with the link (as a string) and the end of entry. + (org-open-at-point): Use `org-offer-links-in-entry' correctly. + + * org.el (org-cycle-internal-local): + Fix bug: allow headings with leading blank characters. + + * org-clock.el (org-clock-persist): + Docstring fix: document the 'history value. + + * org.el (org-insert-link): Fix bug when inserting links to + headlines containing the ">" character. + + * org-crypt.el (org-at-encrypted-entry-p): Fix search boundary. + + * org-compat.el (org-delete-directory): New compatibility function + for Emacs 22, where `delete-directory' does not support recursive + deletion. + + * org-odt.el (org-odt-cleanup-xml-buffers): + Use the new compatibility function. + + * org.el (org-table-map-tables): Fix allowed blocks. + + * org.el (org-edit-special): + * org-src.el (org-edit-src-code): Fix regression: allow editing + HTML and LaTeX source blocks again. + + * org.el (org-nonsticky-props): Add `htmlize-link'. + (org-nonsticky-props): Add `htmlize-link'. + + * org.el (org-edit-special): + * org-src.el (org-edit-src-code): Don't edit in verbatim blocks. + + * org-table.el (org-table-fedit-lisp-indent) + (orgtbl-self-insert-command): Use `org-delete-backward-char' + instead of `backward-delete-char'. + + * org-src.el (org-edit-src-code): Fix another bug about editing + special blocks "example" and "verbatim". + + * org.el (org-structure-template-alist): Add verbatim. + (org-edit-special): Fix bug about editing special blocks + "example" and "verbatim". + + * org.el (org-delete-backward-char, org-delete-char): + Save match data, `delete-backward-char' and `delete-char' don't. + + * org.el (org-enable-table-editor, org-insert-heading) + (org-remove-timestamp-with-keyword, org-self-insert-command): + * org-table.el (org-table-fedit-lisp-indent) + (orgtbl-self-insert-command): + * org-latex.el (org-export-latex-subcontent): + * org-clock.el (org-clocktable-write-default): + * org-ascii.el (org-export-ascii-preprocess): + Use `delete-backward-char' instead of `backward-delete-char'. + + * org.el (org-todo): Ignore the comment string when changing the + TODO state of a headline. + (org-edit-special): Fix docstring. + (org-in-src-block-p): Small enhancement. + + * org-publish.el (org-publish-org-to): Call `org-export-as-*' + functions with the correct list of arguments. + + * org-html.el (org-export-as-html): Delete obsolete arg `hidden'. + (org-export-as-html-and-open, org-export-as-html-batch) + (org-export-region-as-html): Don't use obsolete arg. + + * org-ascii.el (org-export-as-ascii): Delete obsolete arg `hidden'. + (org-export-as-ascii-to-buffer): Don't use obsolete arg. + + * org.el (org-in-fixed-width-region-p): Save match data. + (org-in-src-block-p): Use case-folding for searching the block + boundaries. + (org-activate-plain-links, org-activate-angle-links) + (org-activate-bracket-links): Prevent link activation in + source code blocks. + + * org-odt.el (org-odt-cleanup-xml-buffers): Fix Emacs Bug#13197 by + setting the correct buffer before marking it unmodified to + silently kill him. + + * org.el (org-set-font-lock-defaults): Don't activate links in + source code blocks and fixed-width regions. + + * org-agenda.el (org-agenda-finalize): Fix links activation. + + * org.el (org-open-at-point): Throw the correct error on + non-links. Use `user-error' instead of `error'. + + * org.el (org-in-fixed-width-region-p): Define before use. + + * org-src.el (org-in-src-block-p): Declare function. + + * org-compat.el: Fix bug: don't use `eval-when-compile' when + aliasing `user-error'. + + * org-agenda.el (org-agenda-skip): Only check if point is + inside a code block, not at a code block. + + * org.el (org-in-fixed-width-region-p): + Rewrite using org-element.el. + + * org.el (org-fill-paragraph): Fill correctly in source code block. + + * org.el (org-in-fixed-width-region-p): New function. + (org-edit-special): Fix bug: make sure to DTRT in every + special environment. Also use the new function to check + against fixed-width environment. + + * org-src.el (org-edit-src-code): Check if we are in a source code + block with `org-in-src-block-p'. Slightly reformat the docstring. + + * org.el (org-in-src-block-p): Return t when point is at the + #+BEGIN_SRC/#+END_SRC lines unless the new optional parameter + 'inside is set to t. + + * ob-exp.el (obe-marker): Delete useless var. + + * org-src.el (org-edit-src-code): Fix bug triggered by the sexp + (copy-marker nil) on Emacs <24.1. + +2013-01-09 Dmitry Antipov + + * org-agenda.el (org-agenda-get-restriction-and-command): + * org-capture.el (org-capture-place-template): + * org-colview.el (org-dblock-write:columnview): + * org-mobile.el (org-mobile-locate-entry): + * org-table.el (org-table-convert-region): + * org.el (org-update-statistics-cookies): Use `point-marker'. + +2013-01-09 Eric Schulte + + * org-exp.el (org-export-string): Pass the dir option on through + to any subsequent export functions. + +2013-01-09 Henning Weiss (tiny change) + + * org-mobile.el (org-mobile-sumo-agenda-command): Remove match + description from block agendas when they have a title. + +2013-01-09 Jambunathan K + + * org-odt.el (org-export-as-odt-batch): Init `org-odt-zip-dir'. + Fix Emacs Bug#13254. + + * org-odt.el (org-odt-format-org-link): Add check for presence of + description in headline links. + +2013-01-09 Michael Gauland (tiny change) + + * org-src.el: Create a marker to pass to copy-marker. + +2013-01-09 Nicolas Goaziou + + * org.el (org-setup-filling): Set `auto-fill-inhibit-regexp' to + nil because `org-adaptive-fill-function' already determines which + lines should be filled. + + * org.el (org-fill-paragraph): Small refactoring. + + * org-element.el (org-element--parse-elements) + (org-element-at-point): Fix parsing of a list in a block in a list. + +2013-01-09 Sebastien Vauban + + * org.el (org-copy-subtree, org-paste-subtree): + Fix whitespace handling when copying/pasting a subtree. + 2012-12-20 Michael Albinus * ob.el (org-babel-temp-file): Fix setting of @@ -129,9 +483,8 @@ * 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.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. === modified file 'lisp/org/ob-eval.el' --- lisp/org/ob-eval.el 2013-01-02 16:13:04 +0000 +++ lisp/org/ob-eval.el 2013-01-09 08:30:21 +0000 @@ -30,6 +30,7 @@ (eval-when-compile (require 'cl)) (defvar org-babel-error-buffer-name "*Org-Babel Error Output*") +(declare-function org-babel-temp-file "ob-core" (prefix &optional suffix)) (defun org-babel-eval-error-notify (exit-code stderr) "Open a buffer to display STDERR and a message with the value of EXIT-CODE." @@ -142,6 +143,11 @@ shell-file-name "/bin/sh")) exit-status) + ;; There is an error in `process-file' when `error-file' exists. + ;; This is fixed in Emacs trunk as of 2012-12-21; let's use this + ;; workaround for now. + (unless (file-remote-p default-directory) + (delete-file error-file)) (if (or replace (and output-buffer (not (or (bufferp output-buffer) (stringp output-buffer))))) === modified file 'lisp/org/ob-exp.el' --- lisp/org/ob-exp.el 2013-01-01 09:11:05 +0000 +++ lisp/org/ob-exp.el 2013-01-08 14:27:18 +0000 @@ -28,7 +28,6 @@ (eval-when-compile (require 'cl)) -(defvar obe-marker nil) (defvar org-current-export-file) (defvar org-babel-lob-one-liner-regexp) (defvar org-babel-ref-split-regexp) === modified file 'lisp/org/org-agenda.el' --- lisp/org/org-agenda.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-agenda.el 2013-01-08 18:49:37 +0000 @@ -840,7 +840,7 @@ :group 'org-agenda-daily/weekly :type 'boolean) -(defcustom org-agenda-dim-blocked-tasks t +(defcustom org-agenda-dim-blocked-tasks nil "Non-nil means dim blocked tasks in the agenda display. This causes some overhead during agenda construction, but if you have turned on `org-enforce-todo-dependencies', @@ -857,6 +857,7 @@ will only be dimmed." :group 'org-agenda-daily/weekly :group 'org-agenda-todo-list + :version "24.3" :type '(choice (const :tag "Do not dim" nil) (const :tag "Dim to a gray face" t) @@ -889,7 +890,7 @@ :version "24.1" :type 'boolean) -(define-obsolete-variable-alias 'org-agenda-menu-two-column 'org-agenda-menu-two-columns "24.3") +(org-define-obsolete-variable-alias 'org-agenda-menu-two-column 'org-agenda-menu-two-columns "24.3") (defcustom org-agenda-menu-two-columns nil "Non-nil means, use two columns to show custom commands in the dispatcher. @@ -899,7 +900,7 @@ :version "24.1" :type 'boolean) -(define-obsolete-variable-alias 'org-finalize-agenda-hook 'org-agenda-finalize-hook "24.3") +(org-define-obsolete-variable-alias 'org-finalize-agenda-hook 'org-agenda-finalize-hook "24.3") (defcustom org-agenda-finalize-hook nil "Hook run just before displaying an agenda buffer. The buffer is still writable when the hook is called. @@ -1651,6 +1652,23 @@ :group 'org-agenda-line-format :type 'boolean) +(defcustom org-agenda-use-tag-inheritance '(todo search timeline agenda) + "List of agenda view types where to use tag inheritance. + +In tags/tags-todo/tags-tree agenda views, tag inheritance is +controlled by `org-use-tag-inheritance'. In other agenda types, +`org-use-tag-inheritance' is not used when selecting the agenda +entries, but you may want the agenda to use the inherited tags +anyway, e.g. for later tag filtering. + +The default value reset tags in every agenda type. Setting this +option to nil will speed up non-tags agenda view a lot. + +Allowed value are 'todo, 'search, 'timeline and 'agenda." + :version "24.3" + :group 'org-agenda + :type '(repeat (symbol :tag "Agenda type"))) + (defcustom org-agenda-hide-tags-regexp nil "Regular expression used to filter away specific tags in agenda views. This means that these tags will be present, but not be shown in the agenda @@ -2012,6 +2030,7 @@ (org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile) (org-defkey org-agenda-mode-map "m" 'org-agenda-bulk-mark) (org-defkey org-agenda-mode-map "*" 'org-agenda-bulk-mark-all) +(org-defkey org-agenda-mode-map "#" 'org-agenda-dim-blocked-tasks) (org-defkey org-agenda-mode-map "%" 'org-agenda-bulk-mark-regexp) (org-defkey org-agenda-mode-map "u" 'org-agenda-bulk-unmark) (org-defkey org-agenda-mode-map "U" 'org-agenda-bulk-unmark-all) @@ -2664,7 +2683,7 @@ (add-text-properties (match-beginning 2) (match-end 2) '(face bold) header)) header))) - (setq header-end (move-marker (make-marker) (point))) + (setq header-end (point-marker)) (while t (setq custom1 custom) (when (eq rmheader t) @@ -3194,7 +3213,7 @@ (kill-buffer (current-buffer)) (message "Plain text written to %s" file)))))))) (set-buffer (or agenda-bufname - (and (called-interactively-p 'any) (buffer-name)) + (and (org-called-interactively-p 'any) (buffer-name)) org-agenda-buffer-name))) (when open (org-open-file file))) @@ -3514,44 +3533,60 @@ (save-excursion (let ((inhibit-read-only t)) (goto-char (point-min)) - (while (org-activate-bracket-links (point-max)) - (add-text-properties (match-beginning 0) (match-end 0) - '(face org-link))) - (while (org-activate-plain-links (point-max)) - (add-text-properties (match-beginning 0) (match-end 0) - '(face org-link))) - (org-agenda-align-tags) + (save-excursion + (while (org-activate-bracket-links (point-max)) + (add-text-properties (match-beginning 0) (match-end 0) + '(face org-link)))) + (save-excursion + (while (org-activate-plain-links (point-max)) + (add-text-properties (match-beginning 0) (match-end 0) + '(face org-link)))) + (unless (eq org-agenda-remove-tags t) + (org-agenda-align-tags)) (unless org-agenda-with-colors - (remove-text-properties (point-min) (point-max) '(face nil)))) - (if (and (boundp 'org-agenda-overriding-columns-format) - org-agenda-overriding-columns-format) - (org-set-local 'org-agenda-overriding-columns-format - org-agenda-overriding-columns-format)) - (if (and (boundp 'org-agenda-view-columns-initially) - org-agenda-view-columns-initially) - (org-agenda-columns)) - (when org-agenda-fontify-priorities - (org-agenda-fontify-priorities)) - (when (and org-agenda-dim-blocked-tasks org-blocker-hook) - (org-agenda-dim-blocked-tasks)) - ;; We need to widen when `org-agenda-finalize' is called from - ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in') - (save-restriction - (widen) - (org-agenda-mark-clocking-task)) - (when org-agenda-entry-text-mode - (org-agenda-entry-text-hide) - (org-agenda-entry-text-show)) - (if (functionp 'org-habit-insert-consistency-graphs) - (org-habit-insert-consistency-graphs)) - (let ((inhibit-read-only t)) - (run-hooks 'org-agenda-finalize-hook)) - (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) - (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter :preset-filter)) - (org-agenda-filter-apply org-agenda-tag-filter 'tag)) - (when (or org-agenda-category-filter (get 'org-agenda-category-filter :preset-filter)) - (org-agenda-filter-apply org-agenda-category-filter 'category)) - (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)))) + (remove-text-properties (point-min) (point-max) '(face nil))) + (if (and (boundp 'org-agenda-overriding-columns-format) + org-agenda-overriding-columns-format) + (org-set-local 'org-agenda-overriding-columns-format + org-agenda-overriding-columns-format)) + (if (and (boundp 'org-agenda-view-columns-initially) + org-agenda-view-columns-initially) + (org-agenda-columns)) + (when org-agenda-fontify-priorities + (org-agenda-fontify-priorities)) + (when (and org-agenda-dim-blocked-tasks org-blocker-hook) + (org-agenda-dim-blocked-tasks)) + ;; We need to widen when `org-agenda-finalize' is called from + ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in') + (when org-clock-current-task + (save-restriction + (widen) + (org-agenda-mark-clocking-task))) + (when org-agenda-entry-text-mode + (org-agenda-entry-text-hide) + (org-agenda-entry-text-show)) + (if (and (functionp 'org-habit-insert-consistency-graphs) + (save-excursion (next-single-property-change (point-min) 'org-habit-p))) + (org-habit-insert-consistency-graphs)) + (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) + (when (delq nil (mapcar (lambda (tp) (org-agenda-check-type nil tp)) + org-agenda-use-tag-inheritance)) + (let (mrk) + (save-excursion + (goto-char (point-min)) + (while (equal (forward-line) 0) + (when (setq mrk (or (get-text-property (point) 'org-hd-marker) + (get-text-property (point) 'org-hd-marker))) + (put-text-property (point-at-bol) (point-at-eol) + 'tags (org-with-point-at mrk + (delete-dups + (mapcar 'downcase (org-get-tags-at)))))))))) + (run-hooks 'org-agenda-finalize-hook) + (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter :preset-filter)) + (org-agenda-filter-apply org-agenda-tag-filter 'tag)) + (when (or org-agenda-category-filter (get 'org-agenda-category-filter :preset-filter)) + (org-agenda-filter-apply org-agenda-category-filter 'category)) + (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local))))) (defun org-agenda-mark-clocking-task () "Mark the current clock entry in the agenda if it is present." @@ -3607,15 +3642,18 @@ ((equal p h) 'bold))) (overlay-put ov 'org-type 'org-priority))))) -(defun org-agenda-dim-blocked-tasks () +(defun org-agenda-dim-blocked-tasks (&optional invisible) + (interactive "P") "Dim currently blocked TODO's in the agenda display." + (message "Dim or hide blocked tasks...") (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo) (delete-overlay o))) (overlays-in (point-min) (point-max))) (save-excursion (let ((inhibit-read-only t) (org-depend-tag-blocked nil) - (invis (eq org-agenda-dim-blocked-tasks 'invisible)) + (invis (or (not (null invisible)) + (eq org-agenda-dim-blocked-tasks 'invisible))) org-blocked-by-checkboxes invis1 b e p ov h l) (goto-char (point-min)) @@ -3636,7 +3674,8 @@ (if invis1 (overlay-put ov 'invisible t) (overlay-put ov 'face 'org-agenda-dimmed-todo-face)) - (overlay-put ov 'org-type 'org-blocked-todo))))))) + (overlay-put ov 'org-type 'org-blocked-todo)))))) + (message "Dim or hide blocked tasks...done")) (defvar org-agenda-skip-function nil "Function to be called at each match during agenda construction. @@ -3656,7 +3695,7 @@ Also moves point to the end of the skipped region, so that search can continue from there." (let ((p (point-at-bol)) to) - (when (org-in-src-block-p) (throw :skip t)) + (when (org-in-src-block-p t) (throw :skip t)) (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) (get-text-property p :org-archived) (org-end-of-subtree t) @@ -4405,7 +4444,7 @@ (setq marker (org-agenda-new-marker (point)) category (org-get-category) category-pos (get-text-property (point) 'org-category-position) - tags (org-get-tags-at (point)) + tags (org-get-tags-at nil t) txt (org-agenda-format-item "" (buffer-substring-no-properties @@ -5229,7 +5268,7 @@ category-pos (get-text-property (point) 'org-category-position) txt (org-trim (buffer-substring (match-beginning 2) (match-end 0))) - tags (org-get-tags-at (point)) + tags (org-get-tags-at nil t) txt (org-agenda-format-item "" txt category tags t) priority (1+ (org-get-priority txt)) todo-state (org-get-todo-state)) @@ -5389,7 +5428,7 @@ clockp (and org-agenda-include-inactive-timestamps (or (string-match org-clock-string tmp) (string-match "]-+\\'" tmp))) - warntime (org-entry-get (point) "APPT_WARNTIME") + warntime (get-text-property (point) 'org-appt-warntime) donep (member todo-state org-done-keywords)) (if (or scheduledp deadlinep closedp clockp (and donep org-agenda-skip-timestamp-if-done)) @@ -5408,7 +5447,7 @@ (assoc (point) deadline-position-alist)) (throw :skip nil)) (setq hdmarker (org-agenda-new-marker) - tags (org-get-tags-at)) + tags (org-get-tags-at nil t)) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq head (or (match-string 1) "")) (setq txt (org-agenda-format-item @@ -5458,10 +5497,9 @@ (setq marker (org-agenda-new-marker beg) category (org-get-category beg) category-pos (get-text-property beg 'org-category-position) - tags (save-excursion (org-backward-heading-same-level 0) - (org-get-tags-at)) + tags (save-excursion (org-back-to-heading t) (org-get-tags-at nil t)) todo-state (org-get-todo-state) - warntime (org-entry-get (point) "APPT_WARNTIME") + warntime (get-text-property (point) 'org-appt-warntime) extra nil) (dolist (r (if (stringp result) @@ -5510,7 +5548,6 @@ (org-no-warnings (let ((calendar-date-style 'european) (european-calendar-style t)) (diary-date day month year mark)))) -(defalias 'org-float 'diary-float) ;; Define the` org-class' function (defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks) @@ -5629,7 +5666,7 @@ (setq txt org-agenda-no-heading-message) (goto-char (match-beginning 0)) (setq hdmarker (org-agenda-new-marker) - tags (org-get-tags-at)) + tags (org-get-tags-at nil t)) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq txt (match-string 1)) (when extra @@ -5833,13 +5870,13 @@ (not (= diff 0)))) (setq txt nil) (setq category (org-get-category) - warntime (org-entry-get (point) "APPT_WARNTIME") + warntime (get-text-property (point) 'org-appt-warntime) category-pos (get-text-property (point) 'org-category-position)) (if (not (re-search-backward "^\\*+[ \t]+" nil t)) (setq txt org-agenda-no-heading-message) (goto-char (match-end 0)) (setq pos1 (match-beginning 0)) - (setq tags (org-get-tags-at pos1)) + (setq tags (org-get-tags-at pos1 t)) (setq head (buffer-substring-no-properties (point) (progn (skip-chars-forward "^\r\n") @@ -5923,7 +5960,7 @@ (match-string 1) d1 'past show-all (current-buffer) pos) diff (- d2 d1) - warntime (org-entry-get (point) "APPT_WARNTIME")) + warntime (get-text-property (point) 'org-appt-warntime)) (setq pastschedp (and todayp (< diff 0))) (setq did-habit-check-p nil) ;; When to show a scheduled item in the calendar: @@ -5969,7 +6006,7 @@ pastschedp)) (setq mm (assoc pos1 deadline-position-alist))) (throw :skip nil))) - (setq tags (org-get-tags-at)) + (setq tags (org-get-tags-at nil t)) (setq head (buffer-substring-no-properties (point) (progn (skip-chars-forward "^\r\n") (point)))) @@ -6051,7 +6088,7 @@ (setq txt org-agenda-no-heading-message) (goto-char (match-beginning 0)) (setq hdmarker (org-agenda-new-marker (point))) - (setq tags (org-get-tags-at)) + (setq tags (org-get-tags-at nil t)) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq head (match-string 1)) (let ((remove-re @@ -6212,12 +6249,7 @@ (match-string 2 txt)) t t txt)))) (when (derived-mode-p 'org-mode) - (setq effort - (condition-case nil - (org-get-effort - (or (get-text-property 0 'org-hd-marker txt) - (get-text-property 0 'org-marker txt))) - (error nil))) + (setq effort (ignore-errors (get-text-property 0 'org-effort txt))) (when effort (setq neffort (org-duration-string-to-minutes effort) effort (setq effort (concat "[" effort "]"))))) @@ -6735,7 +6767,8 @@ (defun org-agenda-check-type (error &rest types) "Check if agenda buffer is of allowed type. -If ERROR is non-nil, throw an error, otherwise just return nil." +If ERROR is non-nil, throw an error, otherwise just return nil. +Allowed types are 'agenda 'timeline 'todo 'tags 'search." (if (not org-agenda-type) (error "No Org agenda currently displayed") (if (memq org-agenda-type types) @@ -7669,7 +7702,7 @@ ""))) (force-mode-line-update)) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-agenda-post-command-hook 'org-agenda-update-agenda-type "24.3") (defun org-agenda-update-agenda-type () @@ -7890,29 +7923,45 @@ (unless no-update (org-agenda-redo)))) (defun org-agenda-open-link (&optional arg) - "Follow the link in the current line, if any. -This looks for a link in the displayed line in the agenda. It also looks -at the text of the entry itself." + "Open the link(s) in the current entry, if any. +This looks for a link in the displayed line in the agenda. +It also looks at the text of the entry itself." (interactive "P") (let* ((marker (or (org-get-at-bol 'org-hd-marker) (org-get-at-bol 'org-marker))) (buffer (and marker (marker-buffer marker))) (prefix (buffer-substring - (point-at-bol) (point-at-eol)))) + (point-at-bol) (point-at-eol))) + (lkall (org-offer-links-in-entry buffer marker arg prefix)) + (lk (car lkall)) + (lkend (cdr lkall)) + trg) (cond - (buffer + ((and buffer (stringp lk)) (with-current-buffer buffer - (save-excursion - (save-restriction - (widen) - (goto-char marker) - (org-offer-links-in-entry arg prefix))))) + (setq trg (and (string-match org-bracket-link-regexp lk) + (match-string 1 lk))) + (if (or (not trg) (string-match org-any-link-re trg)) + (save-excursion + (save-restriction + (widen) + (goto-char marker) + (when (search-forward lk nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point)))) + ;; This is an internal link, widen the buffer + (switch-to-buffer-other-window buffer) + (widen) + (goto-char marker) + (when (search-forward lk nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point))))) ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)")) (save-excursion (beginning-of-line 1) (looking-at (concat ".*?\\(" org-bracket-link-regexp "\\)")))) (org-open-link-from-string (match-string 1))) - (t (error "No link to open here"))))) + (t (message "No link to open here"))))) (defun org-agenda-copy-local-variable (var) "Get a variable from a referenced buffer and install it here." @@ -8313,35 +8362,37 @@ (interactive) (org-agenda-priority 'down)) -(defun org-agenda-priority (&optional force-direction show) +(defun org-agenda-priority (&optional force-direction) "Set the priority of line at point, also in Org-mode file. This changes the line at point, all other lines in the agenda referring to -the same tree node, and the headline of the tree node in the Org-mode file." +the same tree node, and the headline of the tree node in the Org-mode file. +Called with a universal prefix arg, show the priority instead of setting it." (interactive "P") - (if (equal force-direction '(4)) (setq show t)) - (unless org-enable-priority-commands - (error "Priority commands are disabled")) - (org-agenda-check-no-diary) - (let* ((marker (or (org-get-at-bol 'org-marker) - (org-agenda-error))) - (hdmarker (org-get-at-bol 'org-hd-marker)) - (buffer (marker-buffer hdmarker)) - (pos (marker-position hdmarker)) - (inhibit-read-only t) - newhead) - (org-with-remote-undo buffer - (with-current-buffer buffer - (widen) - (goto-char pos) - (org-show-context 'agenda) - (save-excursion - (and (outline-next-heading) - (org-flag-heading nil))) ; show the next heading - (funcall 'org-priority force-direction show) - (end-of-line 1) - (setq newhead (org-get-heading))) - (org-agenda-change-all-lines newhead hdmarker) - (beginning-of-line 1)))) + (if (equal force-direction '(4)) + (org-show-priority) + (unless org-enable-priority-commands + (error "Priority commands are disabled")) + (org-agenda-check-no-diary) + (let* ((marker (or (org-get-at-bol 'org-marker) + (org-agenda-error))) + (hdmarker (org-get-at-bol 'org-hd-marker)) + (buffer (marker-buffer hdmarker)) + (pos (marker-position hdmarker)) + (inhibit-read-only t) + newhead) + (org-with-remote-undo buffer + (with-current-buffer buffer + (widen) + (goto-char pos) + (org-show-context 'agenda) + (save-excursion + (and (outline-next-heading) + (org-flag-heading nil))) ; show the next heading + (funcall 'org-priority force-direction) + (end-of-line 1) + (setq newhead (org-get-heading))) + (org-agenda-change-all-lines newhead hdmarker) + (beginning-of-line 1))))) ;; FIXME: should fix the tags property of the agenda line. (defun org-agenda-set-tags (&optional tag onoff) === modified file 'lisp/org/org-ascii.el' --- lisp/org/org-ascii.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-ascii.el 2013-01-08 14:27:18 +0000 @@ -131,7 +131,7 @@ "Call `org-export-as-ascii` with output to a temporary buffer. No file is created. The prefix ARG is passed through to `org-export-as-ascii'." (interactive "P") - (org-export-as-ascii arg nil nil "*Org ASCII Export*") + (org-export-as-ascii arg nil "*Org ASCII Export*") (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window "*Org ASCII Export*"))) @@ -183,23 +183,19 @@ (goto-char end) (set-mark (point)) ;; to activate the region (goto-char beg) - (setq rtn (org-export-as-ascii - nil nil ext-plist - buffer body-only)) + (setq rtn (org-export-as-ascii nil ext-plist buffer body-only)) (if (fboundp 'deactivate-mark) (deactivate-mark)) (if (and (org-called-interactively-p 'any) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))) ;;;###autoload -(defun org-export-as-ascii (arg &optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-ascii (arg &optional ext-plist to-buffer body-only pub-dir) "Export the outline as a pretty ASCII file. If there is an active region, export only the region. The prefix ARG specifies how many levels of the outline should become underlined headlines, default is 3. Lower levels will become bulleted -lists. When HIDDEN is non-nil, don't display the ASCII buffer. -EXT-PLIST is a property list with external parameters overriding +lists. 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 === modified file 'lisp/org/org-capture.el' --- lisp/org/org-capture.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-capture.el 2013-01-08 14:27:18 +0000 @@ -979,7 +979,7 @@ (show-all) (goto-char (org-capture-get :pos)) (org-set-local 'org-capture-target-marker - (move-marker (make-marker) (point))) + (point-marker)) (org-set-local 'outline-level 'org-outline-level) (let* ((template (org-capture-get :template)) (type (org-capture-get :type))) === modified file 'lisp/org/org-clock.el' --- lisp/org/org-clock.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-clock.el 2013-01-08 14:27:18 +0000 @@ -35,6 +35,7 @@ (declare-function calendar-absolute-from-iso "cal-iso" (&optional date)) (declare-function notifications-notify "notifications" (&rest params)) (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label)) +(declare-function org-refresh-properties "org" (dprop tprop)) (defvar org-time-stamp-formats) (defvar org-ts-what) (defvar org-frame-title-format-backup frame-title-format) @@ -159,12 +160,15 @@ The clock is resumed when Emacs restarts. When this is t, both the running clock, and the entire clock history are saved. When this is the symbol `clock', only the -running clock is saved. - -When Emacs restarts with saved clock information, the file containing the -running clock as well as all files mentioned in the clock history will -be visited. -All this depends on running `org-clock-persistence-insinuate' in .emacs" +running clock is saved. When this is the symbol `history', only +the clock history is saved. + +When Emacs restarts with saved clock information, the file containing +the running clock as well as all files mentioned in the clock history +will be visited. + +All this depends on running `org-clock-persistence-insinuate' in your +Emacs initialization file." :group 'org-clock :type '(choice (const :tag "Just the running clock" clock) @@ -201,7 +205,7 @@ (const :tag "Standard beep" t) (file :tag "Play sound file"))) -(define-obsolete-variable-alias 'org-clock-modeline-total +(org-define-obsolete-variable-alias 'org-clock-modeline-total 'org-clock-mode-line-total "24.3") (defcustom org-clock-mode-line-total 'auto @@ -1078,6 +1082,7 @@ make this the default behavior.)" (interactive "P") (setq org-clock-notification-was-shown nil) + (org-refresh-properties org-effort-property 'org-effort) (catch 'abort (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) (org-clocking-p))) @@ -1199,7 +1204,7 @@ (setq org-clock-start-time (apply 'encode-time (org-parse-time-string (match-string 1)))) - (setq org-clock-effort (org-get-effort)) + (setq org-clock-effort (get-text-property (point) 'org-effort)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start)))) ((eq org-clock-in-resume 'auto-restart) @@ -1219,7 +1224,7 @@ (beginning-of-line 1) (org-indent-line-to (- (org-get-indentation) 2))) (insert org-clock-string " ") - (setq org-clock-effort (org-get-effort)) + (setq org-clock-effort (get-text-property (point) 'org-effort)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start))) (setq org-clock-start-time === modified file 'lisp/org/org-colview.el' --- lisp/org/org-colview.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-colview.el 2013-01-08 14:27:18 +0000 @@ -1243,7 +1243,7 @@ :skip-empty-rows When t, skip rows where all specifiers other than ITEM are empty. :format When non-nil, specify the column view format to use." - (let ((pos (move-marker (make-marker) (point))) + (let ((pos (point-marker)) (hlines (plist-get params :hlines)) (vlines (plist-get params :vlines)) (maxlevel (plist-get params :maxlevel)) === modified file 'lisp/org/org-compat.el' --- lisp/org/org-compat.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-compat.el 2013-01-08 14:27:18 +0000 @@ -169,6 +169,24 @@ (set-buffer-modified-p modified-p)) (decompose-region beg end))) +(defmacro org-define-obsolete-function-alias (o-name c-name when &optional doc) + "Reconcile the two-argument form of +`define-obsolete-function-alias' in XEmacs/Emacs 22 with the 3-4 +argument form in Emacs 23 and later." + (if (or (featurep 'xemacs) + (< emacs-major-version 23)) + `(define-obsolete-function-alias ,o-name ,c-name) + `(define-obsolete-function-alias ,o-name ,c-name ,when ,doc))) + +(defmacro org-define-obsolete-variable-alias (o-name c-name when &optional doc) + "Reconcile the two-argument form of +`define-obsolete-variable-alias' in XEmacs/Emacs 22 with the 3-4 +argument form in Emacs 23 and later." + (if (or (featurep 'xemacs) + (< emacs-major-version 23)) + `(define-obsolete-variable-alias ,o-name ,c-name) + `(define-obsolete-variable-alias ,o-name ,c-name ,when ,doc))) + ;; Miscellaneous functions (defun org-add-hook (hook function &optional append local) @@ -195,9 +213,8 @@ ignored in this case." (cond ((if (fboundp 'window-full-width-p) (not (window-full-width-p window)) - (> (frame-width) (window-width window))) - ;; do nothing if another window would suffer - ) + ;; do nothing if another window would suffer + (> (frame-width) (window-width window)))) ((and (fboundp 'fit-window-to-buffer) (not shrink-only)) (fit-window-to-buffer window max-height min-height)) ((fboundp 'shrink-window-if-larger-than-buffer) @@ -257,7 +274,6 @@ (when (boundp 'zmacs-regions) (setq zmacs-regions t))))) - ;; Invisibility compatibility (defun org-remove-from-invisibility-spec (arg) @@ -372,6 +388,20 @@ (time-to-seconds (or time (current-time))) (float-time time))) +;; `user-error' is only available from 24.2.50 on +(unless (fboundp 'user-error) + (defalias 'user-error 'error)) + +(defmacro org-no-popups (&rest body) + "Suppress popup windows. +Let-bind some variables to nil around BODY to achieve the desired +effect, which variables to use depends on the Emacs version." + (if (org-version-check "24.2.50" "" :predicate) + `(let (pop-up-frames display-buffer-alist) + ,@body) + `(let (pop-up-frames special-display-buffer-names special-display-regexps special-display-function) + ,@body))) + (if (fboundp 'string-match-p) (defalias 'org-string-match-p 'string-match-p) (defun org-string-match-p (regexp string &optional start) @@ -384,7 +414,7 @@ (save-match-data (apply 'looking-at args)))) - ; XEmacs does not have `looking-back'. +;; XEmacs does not have `looking-back'. (if (fboundp 'looking-back) (defalias 'org-looking-back 'looking-back) (defun org-looking-back (regexp &optional limit greedy) @@ -435,12 +465,34 @@ ;; `condition-case-unless-debug' has been introduced in Emacs 24.1 ;; `condition-case-no-debug' has been introduced in Emacs 23.1 -(defalias 'org-condition-case-unless-debug +(defmacro org-condition-case-unless-debug (var bodyform &rest handlers) + (declare (debug condition-case) (indent 2)) (or (and (fboundp 'condition-case-unless-debug) - 'condition-case-unless-debug) + `(condition-case-unless-debug ,var ,bodyform ,@handlers)) (and (fboundp 'condition-case-no-debug) - 'condition-case-no-debug) - 'condition-case)) + `(condition-case-no-debug ,var ,bodyform ,@handlers)) + `(condition-case ,var ,bodyform ,@handlers))) + +;; RECURSIVE has been introduced with Emacs 23.2. +;; This is copying and adapted from `tramp-compat-delete-directory' +(defun org-delete-directory (directory &optional recursive) + "Compatibility function for `delete-directory'." + (if (null recursive) + (delete-directory directory) + (condition-case nil + (funcall 'delete-directory directory recursive) + ;; This Emacs version does not support the RECURSIVE flag. We + ;; use the implementation from Emacs 23.2. + (wrong-number-of-arguments + (setq directory (directory-file-name (expand-file-name directory))) + (if (not (file-symlink-p directory)) + (mapc (lambda (file) + (if (eq t (car (file-attributes file))) + (org-delete-directory file recursive) + (delete-file file))) + (directory-files + directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) + (delete-directory directory))))) ;;;###autoload (defmacro org-check-version () === modified file 'lisp/org/org-crypt.el' --- lisp/org/org-crypt.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-crypt.el 2013-01-08 14:27:18 +0000 @@ -1,6 +1,6 @@ ;;; org-crypt.el --- Public key encryption for org-mode entries -;; Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. +;; Copyright (C) 2007-2013 Free Software Foundation, Inc. ;; Emacs Lisp Archive Entry ;; Filename: org-crypt.el @@ -258,7 +258,7 @@ (save-excursion (org-back-to-heading t) (search-forward "-----BEGIN PGP MESSAGE-----" - (save-excursion (org-end-of-subtree t)) t)))) + (save-excursion (outline-next-heading)) t)))) (defun org-crypt-use-before-save-magic () "Add a hook to automatically encrypt entries before a file is saved to disk." === modified file 'lisp/org/org-docbook.el' --- lisp/org/org-docbook.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-docbook.el 2013-01-08 14:27:18 +0000 @@ -274,14 +274,14 @@ $ emacs --batch --load=$HOME/lib/emacs/org.el --visit=MyOrgFile.org --funcall org-export-as-docbook-batch" - (org-export-as-docbook 'hidden)) + (org-export-as-docbook)) ;;;###autoload (defun org-export-as-docbook-to-buffer () "Call `org-export-as-docbook' with output to a temporary buffer. No file is created." (interactive) - (org-export-as-docbook nil nil "*Org DocBook Export*") + (org-export-as-docbook nil "*Org DocBook Export*") (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window "*Org DocBook Export*"))) @@ -334,17 +334,14 @@ (goto-char end) (set-mark (point)) ;; To activate the region (goto-char beg) - (setq rtn (org-export-as-docbook - nil nil - buffer body-only)) + (setq rtn (org-export-as-docbook nil buffer body-only)) (if (fboundp 'deactivate-mark) (deactivate-mark)) (if (and (org-called-interactively-p 'any) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))) ;;;###autoload -(defun org-export-as-docbook-pdf (&optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-docbook-pdf (&optional ext-plist to-buffer body-only pub-dir) "Export as DocBook XML file, and generate PDF file." (interactive "P") (if (or (not org-export-docbook-xslt-proc-command) @@ -360,8 +357,7 @@ (org-combine-plists (org-default-export-plist) ext-plist (org-infile-export-plist)))) - (docbook-buf (org-export-as-docbook hidden ext-plist - to-buffer body-only pub-dir)) + (docbook-buf (org-export-as-docbook ext-plist to-buffer body-only pub-dir)) (filename (buffer-file-name docbook-buf)) (base (file-name-sans-extension filename)) (fofile (concat base ".fo")) @@ -398,8 +394,7 @@ (defvar org-heading-keyword-regexp-format) ; defined in org.el ;;;###autoload -(defun org-export-as-docbook (&optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-docbook (&optional ext-plist to-buffer body-only pub-dir) "Export the current buffer as a DocBook file. If there is an active region, export only the region. When HIDDEN is obsolete and does nothing. EXT-PLIST is a === modified file 'lisp/org/org-element.el' --- lisp/org/org-element.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-element.el 2013-01-08 14:27:18 +0000 @@ -3808,7 +3808,8 @@ 'section)) (plain-list 'item) (table 'table-row)) - (org-element-property :structure element) + (and (memq type '(item plain-list)) + (org-element-property :structure element)) granularity visible-only element)) ;; ELEMENT has contents. Parse objects inside, if ;; GRANULARITY allows it. @@ -4249,8 +4250,11 @@ (plain-list (setq special-flag 'item struct (org-element-property :structure element))) - (table (setq special-flag 'table-row)) - (otherwise (setq special-flag nil))) + (item (setq special-flag nil)) + (property-drawer + (setq special-flag 'node-property struct nil)) + (table (setq special-flag 'table-row struct nil)) + (otherwise (setq special-flag nil struct nil))) (setq end cend) (goto-char cbeg))))))))))) === modified file 'lisp/org/org-exp.el' --- lisp/org/org-exp.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-exp.el 2013-01-08 14:27:18 +0000 @@ -3047,12 +3047,11 @@ (eval ;; convert to fmt -- mimicking `org-run-like-in-org-mode' (list 'let org-local-vars (list (intern (format "org-export-as-%s" fmt)) - nil nil nil ''string t)))) + nil nil ''string t dir)))) (delete-file tmp-file)))) ;;;###autoload -(defun org-export-as-org (arg &optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-org (arg &optional ext-plist to-buffer body-only pub-dir) "Make a copy with not-exporting stuff removed. The purpose of this function is to provide a way to export the source Org file of a webpage in Org format, but with sensitive and/or irrelevant === modified file 'lisp/org/org-faces.el' --- lisp/org/org-faces.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-faces.el 2013-01-08 14:27:18 +0000 @@ -44,6 +44,9 @@ (set-face-doc-string new-face docstring))))) (put 'org-copy-face 'lisp-indent-function 2) +(when (featurep 'xemacs) + (put 'mode-line 'face-alias 'modeline)) + (defgroup org-faces nil "Faces in Org-mode." :tag "Org Faces" === modified file 'lisp/org/org-html.el' --- lisp/org/org-html.el 2013-01-03 01:46:47 +0000 +++ lisp/org/org-html.el 2013-01-08 14:27:18 +0000 @@ -328,7 +328,7 @@ * @licstart The following is the entire license notice for the * JavaScript code in %PATH. * - * Copyright (C) 2012 MathJax + * Copyright (C) 2012-2013 MathJax * * Licensed under the Apache License, Version 2.0 (the \"License\"); * you may not use this file except in compliance with the License. @@ -793,7 +793,7 @@ The prefix ARG specifies how many levels of the outline should become headlines. The default is 3. Lower levels will become bulleted lists." (interactive "P") - (org-export-as-html arg 'hidden) + (org-export-as-html arg) (org-open-file buffer-file-name) (when org-export-kill-product-buffer-when-displayed (kill-buffer (current-buffer)))) @@ -806,14 +806,14 @@ --load=$HOME/lib/emacs/org.el --eval \"(setq org-export-headline-levels 2)\" --visit=MyFile --funcall org-export-as-html-batch" - (org-export-as-html org-export-headline-levels 'hidden)) + (org-export-as-html org-export-headline-levels)) ;;;###autoload (defun org-export-as-html-to-buffer (arg) "Call `org-export-as-html` with output to a temporary buffer. No file is created. The prefix ARG is passed through to `org-export-as-html'." (interactive "P") - (org-export-as-html arg nil nil "*Org HTML Export*") + (org-export-as-html arg nil "*Org HTML Export*") (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window "*Org HTML Export*"))) @@ -865,9 +865,7 @@ (goto-char end) (set-mark (point)) ;; to activate the region (goto-char beg) - (setq rtn (org-export-as-html - nil nil ext-plist - buffer body-only)) + (setq rtn (org-export-as-html nil ext-plist buffer body-only)) (if (fboundp 'deactivate-mark) (deactivate-mark)) (if (and (org-called-interactively-p 'any) (bufferp rtn)) (switch-to-buffer-other-window rtn) @@ -1171,14 +1169,12 @@ (defvar org-heading-keyword-regexp-format) ; defined in org.el ;;;###autoload -(defun org-export-as-html (arg &optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-html (arg &optional ext-plist to-buffer body-only pub-dir) "Export the outline as a pretty HTML 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 become bulleted -lists. HIDDEN is obsolete and does nothing. -EXT-PLIST is a property list with external parameters overriding +lists. 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 === modified file 'lisp/org/org-icalendar.el' --- lisp/org/org-icalendar.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-icalendar.el 2013-01-08 14:27:18 +0000 @@ -327,6 +327,7 @@ tmp pri categories location summary desc uid alarm alarm-time (sexp-buffer (get-buffer-create "*ical-tmp*"))) (org-refresh-category-properties) + (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime) (save-excursion (goto-char (point-min)) (while (re-search-forward re1 nil t) @@ -357,7 +358,7 @@ (org-id-get-create) (or (org-id-get) (org-id-new))) categories (org-export-get-categories) - alarm-time (org-entry-get nil "APPT_WARNTIME") + alarm-time (get-text-property (point) 'org-appt-warntime) alarm-time (if alarm-time (string-to-number alarm-time) 0) alarm "" deadlinep nil scheduledp nil) @@ -676,7 +677,7 @@ (setq fmt (if have-time (replace-regexp-in-string "%Z" org-icalendar-timezone - org-icalendar-date-time-format) + org-icalendar-date-time-format t) ";VALUE=DATE:%Y%m%d")) (concat keyword (format-time-string fmt time (and (org-icalendar-use-UTC-date-timep) === modified file 'lisp/org/org-id.el' --- lisp/org/org-id.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-id.el 2013-01-08 14:27:18 +0000 @@ -83,7 +83,7 @@ :tag "Org ID" :group 'org) -(define-obsolete-variable-alias +(org-define-obsolete-variable-alias 'org-link-to-org-use-id 'org-id-link-to-org-use-id "24.3") (defcustom org-id-link-to-org-use-id nil "Non-nil means storing a link to an Org file will use entry IDs. === modified file 'lisp/org/org-inlinetask.el' --- lisp/org/org-inlinetask.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-inlinetask.el 2013-01-08 14:27:18 +0000 @@ -75,6 +75,9 @@ ;; Also, if you want to use refiling and archiving for inline tasks, ;; The END line must be present to make things work properly. ;; +;; Note that you should not try to use inline tasks within plain list, +;; visibility cycling is known to be problematic when doing so. +;; ;; This package installs one new command: ;; ;; C-c C-x t Insert a new inline task with END line === modified file 'lisp/org/org-install.el' --- lisp/org/org-install.el 2012-10-26 14:42:05 +0000 +++ lisp/org/org-install.el 2013-01-08 14:27:18 +0000 @@ -1,8 +1,10 @@ -;;; org-install.el --- autogenerated file, do not edit +;;; org-install.el --- backward compatibility file for obsolete configuration ;; ;;; Code: (warn "The file org-install is obsolete. -Please change your configuration to (require 'org) instead.") +It is provided here so that (require 'org-install) does not +trigger an error for users with obsolete Emacs configuration. +You can safely remove (require 'org-install) from your config.") (provide 'org-install) === modified file 'lisp/org/org-jsinfo.el' --- lisp/org/org-jsinfo.el 2013-01-03 01:46:47 +0000 +++ lisp/org/org-jsinfo.el 2013-01-08 14:27:18 +0000 @@ -112,7 +112,7 @@ * @licstart The following is the entire license notice for the * JavaScript code in %SCRIPT_PATH. * - * Copyright (C) 2012 Sebastian Rose + * Copyright (C) 2012-2013 Sebastian Rose * * * The JavaScript code in this tag is free software: you can === modified file 'lisp/org/org-latex.el' --- lisp/org/org-latex.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-latex.el 2013-01-08 14:27:18 +0000 @@ -872,7 +872,7 @@ 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. -when PUB-DIR is set, use this as the publishing directory." +When PUB-DIR is set, use this as the publishing directory." (interactive "P") (when (and (not body-only) arg (listp arg)) (setq body-only t)) (run-hooks 'org-export-first-hook) === modified file 'lisp/org/org-list.el' --- lisp/org/org-list.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-list.el 2013-01-08 14:27:18 +0000 @@ -144,15 +144,15 @@ treated as text. This is the most stable way of handling this, which is why it is the default. -When this is the symbol `integrate', then during cycling, plain -list items will *temporarily* be interpreted as outline headlines -with a level given by 1000+i where i is the indentation of the -bullet. This setting can lead to strange effects when switching -visibility to `children', because the first \"child\" in a -subtree decides what children should be listed. If that first -\"child\" is a plain list item with an implied large level -number, all true children and grand children of the outline -heading will be exposed in a children' view." +When this is the symbol `integrate', then integrate plain list +items when cycling, as if they were children of outline headings. + +This setting can lead to strange effects when switching visibility +to `children', because the first \"child\" in a subtree decides +what children should be listed. If that first \"child\" is a +plain list item with an implied large level number, all true +children and grand children of the outline heading will be +exposed in a children' view." :group 'org-plain-lists :type '(choice (const :tag "Never" nil) === modified file 'lisp/org/org-lparse.el' --- lisp/org/org-lparse.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-lparse.el 2013-01-08 14:27:18 +0000 @@ -1718,7 +1718,7 @@ (org-lparse-end-paragraph) (org-lparse-end-list-item (or type "u"))) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-lparse-preprocess-after-blockquote-hook 'org-lparse-preprocess-after-blockquote "24.3") @@ -1736,7 +1736,7 @@ (format "ORG-%s-END %s" (upcase (match-string 2)) (match-string 3))) t t)))) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-lparse-strip-experimental-blocks-maybe-hook 'org-lparse-strip-experimental-blocks-maybe "24.3") === modified file 'lisp/org/org-macs.el' --- lisp/org/org-macs.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-macs.el 2013-01-08 14:27:18 +0000 @@ -126,6 +126,15 @@ (org-move-to-column ,col))))) (def-edebug-spec org-preserve-lc (body)) +;; Copied from bookmark.el +(defmacro org-with-buffer-modified-unmodified (&rest body) + "Run BODY while preserving the buffer's `buffer-modified-p' state." + (org-with-gensyms (was-modified) + `(let ((,was-modified (buffer-modified-p))) + (unwind-protect + (progn ,@body) + (set-buffer-modified-p ,was-modified))))) + (defmacro org-without-partial-completion (&rest body) `(if (and (boundp 'partial-completion-mode) partial-completion-mode === modified file 'lisp/org/org-mobile.el' --- lisp/org/org-mobile.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-mobile.el 2013-01-08 14:27:18 +0000 @@ -304,12 +304,13 @@ ;;;###autoload (defun org-mobile-push () - "Push the current state of Org affairs to the WebDAV directory. + "Push the current state of Org affairs to the target directory. This will create the index file, copy all agenda files there, and also create all custom agenda views, for upload to the mobile phone." (interactive) (let ((a-buffer (get-buffer org-agenda-buffer-name))) - (let ((org-agenda-buffer-name "*SUMO*") + (let ((org-agenda-curbuf-name org-agenda-buffer-name) + (org-agenda-buffer-name "*SUMO*") (org-agenda-tag-filter org-agenda-tag-filter) (org-agenda-redo-command org-agenda-redo-command)) (save-excursion @@ -329,15 +330,17 @@ (org-mobile-create-index-file) (message "Writing checksums...") (org-mobile-write-checksums) - (run-hooks 'org-mobile-post-push-hook)))) + (run-hooks 'org-mobile-post-push-hook))) + (setq org-agenda-buffer-name org-agenda-curbuf-name + org-agenda-this-buffer-name org-agenda-curbuf-name)) (redraw-display) - (when (and a-buffer (buffer-live-p a-buffer)) + (when (buffer-live-p a-buffer) (if (not (get-buffer-window a-buffer)) - (kill-buffer a-buffer) - (let ((cw (selected-window))) - (select-window (get-buffer-window a-buffer)) - (org-agenda-redo) - (select-window cw))))) + (kill-buffer a-buffer) + (let ((cw (selected-window))) + (select-window (get-buffer-window a-buffer)) + (org-agenda-redo) + (select-window cw))))) (message "Files for mobile viewer staged")) (defvar org-mobile-before-process-capture-hook nil @@ -417,7 +420,8 @@ (target-file (expand-file-name org-mobile-index-file org-mobile-directory)) file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds) - + (when (stringp (car def-todo)) + (setq def-todo (list (cons 'sequence def-todo)))) (org-agenda-prepare-buffers (mapcar 'car files-alist)) (setq done-kwds (org-uniquify org-done-keywords-for-agenda)) (setq todo-kwds (org-delete-all @@ -536,7 +540,7 @@ (t (cons (car x) (cons "" (cdr x)))))) org-agenda-custom-commands))) (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo))) - thelist new e key desc type match settings cmds gkey gdesc gsettings cnt) + thelist atitle new e key desc type match settings cmds gkey gdesc gsettings cnt) (cond ((eq org-mobile-agendas 'custom) (setq thelist custom-list)) @@ -588,12 +592,13 @@ (setq cnt 0) (while (setq e (pop cmds)) (setq type (car e) match (nth 1 e) settings (nth 2 e)) + (setq atitle (if (string= "" gdesc) match gdesc)) (setq settings (append gsettings settings)) (setq settings (cons (list 'org-agenda-title-append (concat "KEYS=" gkey "#" (number-to-string (setq cnt (1+ cnt))) - " TITLE: " gdesc " " match "")) + " TITLE: " atitle "")) settings)) (push (list type match settings) new))))) (and new (list "X" "SUMO" (reverse new) @@ -983,7 +988,7 @@ (goto-char (point-max)) (newline) (goto-char (point-max)) - (move-marker (make-marker) (point))))) + (point-marker)))) (let ((file (match-string 1 link)) (path (match-string 2 link))) (setq file (org-link-unescape file)) === modified file 'lisp/org/org-odt.el' --- lisp/org/org-odt.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-odt.el 2013-01-08 14:27:18 +0000 @@ -439,14 +439,14 @@ "meta.xml" "styles.xml"))) ;; kill all xml buffers (mapc (lambda (file) - (let ((buf (find-file-noselect - (expand-file-name file org-odt-zip-dir) t))) - (when (buffer-name buf) - (set-buffer-modified-p nil) - (kill-buffer buf)))) + (with-current-buffer + (find-file-noselect + (expand-file-name file org-odt-zip-dir) t) + (set-buffer-modified-p nil) + (kill-buffer))) xml-files)) ;; delete temporary directory. - (delete-directory org-odt-zip-dir t))))) + (org-delete-directory org-odt-zip-dir t))))) (org-condition-case-unless-debug err (prog1 (progn ,@body) (funcall --cleanup-xml-buffers)) @@ -474,7 +474,7 @@ --load=$HOME/lib/emacs/org.el --eval \"(setq org-export-headline-levels 2)\" --visit=MyFile --funcall org-export-as-odt-batch" - (org-lparse-batch "odt")) + (org-odt-cleanup-xml-buffers (org-lparse-batch "odt"))) ;;; org-export-as-odt ;;;###autoload @@ -1727,6 +1727,7 @@ ((and (string= type "") (or (not thefile) (string= thefile "")) (plist-get org-lparse-opt-plist :section-numbers) + (get-text-property 0 'org-no-description fragment) (setq sec-frag fragment) (or (string-match "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag) (and (setq sec-frag @@ -1756,7 +1757,11 @@ (when (not (member type '("" "file"))) (setq thefile (concat type ":" thefile))) - (let ((org-odt-suppress-xref nil)) + (let ((org-odt-suppress-xref + ;; Typeset link to headlines with description, as a + ;; regular hyperlink. + (and (string= type "") + (not (get-text-property 0 'org-no-description fragment))))) (org-odt-format-link (org-xml-format-desc desc) thefile attr))))))) === modified file 'lisp/org/org-protocol.el' --- lisp/org/org-protocol.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-protocol.el 2013-01-08 14:27:18 +0000 @@ -128,15 +128,15 @@ (filename &optional up)) (declare-function server-edit "server" (&optional arg)) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-protocol-unhex-compound 'org-link-unescape-compound "2011-02-17") -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-protocol-unhex-string 'org-link-unescape "2011-02-17") -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-protocol-unhex-single-byte-sequence 'org-link-unescape-single-byte-sequence "2011-02-17") === modified file 'lisp/org/org-publish.el' --- lisp/org/org-publish.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-publish.el 2013-01-08 14:27:18 +0000 @@ -577,7 +577,7 @@ (setq export-buf-or-file (funcall (intern (concat "org-export-as-" format)) (plist-get plist :headline-levels) - nil plist nil + plist nil (plist-get plist :body-only) pub-dir)) (when (and (bufferp export-buf-or-file) === modified file 'lisp/org/org-src.el' --- lisp/org/org-src.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-src.el 2013-01-08 18:49:37 +0000 @@ -39,6 +39,8 @@ (declare-function org-do-remove-indentation "org" (&optional n)) (declare-function org-at-table.el-p "org" ()) +(declare-function org-in-src-block-p "org" (&optional inside)) +(declare-function org-in-block-p "org" (names)) (declare-function org-get-indentation "org" (&optional line)) (declare-function org-switch-to-buffer-other-window "org" (&rest args)) (declare-function org-pop-to-buffer-same-window @@ -201,41 +203,40 @@ `org-edit-src-save'") (defun org-edit-src-code (&optional context code edit-buffer-name) - "Edit the source CODE example at point. -The example is copied to a separate buffer, and that buffer is -switched to the correct language mode. When done, exit with -\\[org-edit-src-exit]. This will remove the original code in the -Org buffer, and replace it with the edited version. An optional -argument CONTEXT is used by \\[org-edit-src-save] when calling -this function. See `org-src-window-setup' to configure the -display of windows containing the Org buffer and the code -buffer." + "Edit the source CODE block at point. +The code is copied to a separate buffer and the appropriate mode +is turned on. When done, exit with \\[org-edit-src-exit]. This will +remove the original code in the Org buffer, and replace it with the +edited version. An optional argument CONTEXT is used by \\[org-edit-src-save] +when calling this function. See `org-src-window-setup' to configure +the display of windows containing the Org buffer and the code buffer." (interactive) - (unless (eq context 'save) - (setq org-edit-src-saved-temp-window-config (current-window-configuration))) - (let* ((mark (and (org-region-active-p) (mark))) - (case-fold-search t) - (info - ;; If the src region consists in no lines, we insert a blank - ;; line. - (let* ((temp (org-edit-src-find-region-and-lang)) - (beg (nth 0 temp)) - (end (nth 1 temp))) - (if (>= end beg) temp - (goto-char beg) - (insert "\n") - (org-edit-src-find-region-and-lang)))) - (full-info (org-babel-get-src-block-info 'light)) - (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive - (beg (make-marker)) - ;; Move marker with inserted text for case when src block is - ;; just one empty line, i.e. beg == end. - (end (copy-marker nil t)) - (allow-write-back-p (null code)) - block-nindent total-nindent ovl lang lang-f single lfmt buffer msg - begline markline markcol line col transmitted-variables) - (if (not info) - nil + (if (not (or (org-in-block-p '("src" "example" "latex" "html")) + (org-at-table.el-p))) + (user-error "Not in a source code or example block") + (unless (eq context 'save) + (setq org-edit-src-saved-temp-window-config (current-window-configuration))) + (let* ((mark (and (org-region-active-p) (mark))) + (case-fold-search t) + (info + ;; If the src region consists in no lines, we insert a blank + ;; line. + (let* ((temp (org-edit-src-find-region-and-lang)) + (beg (nth 0 temp)) + (end (nth 1 temp))) + (if (>= end beg) temp + (goto-char beg) + (insert "\n") + (org-edit-src-find-region-and-lang)))) + (full-info (org-babel-get-src-block-info 'light)) + (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive + (beg (make-marker)) + ;; Move marker with inserted text for case when src block is + ;; just one empty line, i.e. beg == end. + (end (copy-marker (make-marker) t)) + (allow-write-back-p (null code)) + block-nindent total-nindent ovl lang lang-f single lfmt buffer msg + begline markline markcol line col transmitted-variables) (setq beg (move-marker beg (nth 0 info)) end (move-marker end (nth 1 info)) msg (if allow-write-back-p @@ -244,7 +245,7 @@ "Exit with C-c ' (C-c and single quote)") code (or code (buffer-substring-no-properties beg end)) lang (or (cdr (assoc (nth 2 info) org-src-lang-modes)) - (nth 2 info)) + (nth 2 info)) lang (if (symbolp lang) (symbol-name lang) lang) single (nth 3 info) block-nindent (nth 5 info) @@ -527,6 +528,14 @@ (pos (point)) re1 re2 single beg end lang lfmt match-re1 ind entry) (catch 'exit + (when (org-at-table.el-p) + (re-search-backward "^[\t]*[^ \t|\\+]" nil t) + (setq beg (1+ (point-at-eol))) + (goto-char beg) + (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t) + (progn (goto-char (point-max)) (newline))) + (setq end (1- (point-at-bol))) + (throw 'exit (list beg end 'table.el nil nil 0))) (while (setq entry (pop re-list)) (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry) single (nth 3 entry)) @@ -557,16 +566,7 @@ (throw 'exit (list (match-end 0) end (org-edit-src-get-lang lang) - single lfmt ind))))))))) - (when (org-at-table.el-p) - (re-search-backward "^[\t]*[^ \t|\\+]" nil t) - (setq beg (1+ (point-at-eol))) - (goto-char beg) - (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t) - (progn (goto-char (point-max)) (newline))) - (setq end (point-at-bol)) - (setq ind (org-edit-src-get-indentation beg)) - (throw 'exit (list beg end 'table.el nil nil ind)))))) + single lfmt ind)))))))))))) (defun org-edit-src-get-lang (lang) "Extract the src language." @@ -633,7 +633,8 @@ (unless (org-bound-and-true-p org-edit-src-from-org-mode) (error "This is not a sub-editing buffer, something is wrong")) (widen) - (let* ((beg org-edit-src-beg-marker) + (let* ((fixed-width-p (string-match "Fixed Width" (buffer-name))) + (beg org-edit-src-beg-marker) (end org-edit-src-end-marker) (ovl org-edit-src-overlay) (bufstr (buffer-string)) @@ -670,7 +671,8 @@ (goto-char (point-max)) (insert "\\n"))) (goto-char (point-min)) (if (looking-at "\\s-*") (replace-match " "))) - (when (org-bound-and-true-p org-edit-src-from-org-mode) + (when (and (org-bound-and-true-p org-edit-src-from-org-mode) + (not fixed-width-p)) (org-escape-code-in-region (point-min) (point-max)) (setq delta (+ delta (save-excursion === modified file 'lisp/org/org-table.el' --- lisp/org/org-table.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-table.el 2013-01-08 14:27:18 +0000 @@ -509,10 +509,10 @@ re) (goto-char beg) (beginning-of-line 1) - (setq beg (move-marker (make-marker) (point))) + (setq beg (point-marker)) (goto-char end) (if (bolp) (backward-char 1) (end-of-line 1)) - (setq end (move-marker (make-marker) (point))) + (setq end (point-marker)) ;; Get the right field separator (unless separator (goto-char beg) @@ -1895,7 +1895,7 @@ (if (and (boundp 'font-lock-mode) font-lock-mode) (font-lock-fontify-block)))) (t - (let ((pos (move-marker (make-marker) (point))) + (let ((pos (point-marker)) (coord (if (eq org-table-use-standard-references t) (concat (org-number-to-letters (org-table-current-column)) @@ -3219,7 +3219,7 @@ (let ((key (org-table-current-field-formula 'key 'noerror)) (eql (sort (org-table-get-stored-formulas 'noerror) 'org-table-formula-less-p)) - (pos (move-marker (make-marker) (point))) + (pos (point-marker)) (startline 1) (wc (current-window-configuration)) (sel-win (selected-window)) @@ -3580,7 +3580,7 @@ (beginning-of-line 1) (insert ind)) (goto-char (point-max)) - (backward-delete-char 1))) + (org-delete-backward-char 1))) (goto-char beg)) (t nil)))) @@ -4235,7 +4235,7 @@ (looking-at "[^|\n]* +|")) (let (org-table-may-need-update) (goto-char (1- (match-end 0))) - (backward-delete-char 1) + (org-delete-backward-char 1) (goto-char (match-beginning 0)) (self-insert-command N)) (setq org-table-may-need-update t) === modified file 'lisp/org/org-version.el' --- lisp/org/org-version.el 2012-12-12 16:47:07 +0000 +++ lisp/org/org-version.el 2013-01-08 18:49:37 +0000 @@ -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.3+")) 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 "7.9.2+-GNU-Emacs-24-3 (commit 488eea)")) + (let ((org-git-version "7.9.3+-GNU-Emacs-24-3 (commit 4cac75153)")) org-git-version)) ;;;###autoload (defvar org-odt-data-dir "/usr/share/emacs/etc/org" === modified file 'lisp/org/org.el' --- lisp/org/org.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org.el 2013-01-08 14:27:18 +0000 @@ -1219,7 +1219,15 @@ :type 'boolean) (defcustom org-goto-auto-isearch t - "Non-nil means typing characters in `org-goto' starts incremental search." + "Non-nil means typing characters in `org-goto' starts incremental search. +When nil, you can use these keybindings to navigate the buffer: + + q Quit the org-goto interface + n Go to the next visible heading + p Go to the previous visible heading + f Go one heading forward on same level + b Go one heading backward on same level + u Go one heading up" :group 'org-edit-structure :type 'boolean) @@ -2236,8 +2244,9 @@ (defvar org-blocker-hook nil "Hook for functions that are allowed to block a state change. -Each function gets as its single argument a property list, see -`org-trigger-hook' for more information about this list. +Functions in this hook should not modify the buffer. +Each function gets as its single argument a property list, +see `org-trigger-hook' for more information about this list. If any of the functions in this hook returns nil, the state change is blocked.") @@ -2245,8 +2254,8 @@ (defvar org-trigger-hook nil "Hook for functions that are triggered by a state change. -Each function gets as its single argument a property list with at least -the following elements: +Each function gets as its single argument a property list with at +least the following elements: (:type type-of-change :position pos-at-entry-start :from old-state :to new-state) @@ -2979,7 +2988,7 @@ This may also be a list of tags that should be inherited, or a regexp that matches tags that should be inherited. Additional control is possible with the variable `org-tags-exclude-from-inheritance' which gives an -explicit list of tags to be excluded from inheritance., even if the value of +explicit list of tags to be excluded from inheritance, even if the value of `org-use-tag-inheritance' would select it for inheritance. If this option is t, a match early-on in a tree can lead to a large @@ -3952,7 +3961,7 @@ (beginning-of-line 1) (when (and (looking-at org-table-line-regexp) ;; Exclude tables in src/example/verbatim/clocktable blocks - (not (org-in-block-p '("src" "example")))) + (not (org-in-block-p '("src" "example" "verbatim" "clocktable")))) (save-excursion (funcall function)) (or (looking-at org-table-line-regexp) (forward-char 1))) @@ -5007,13 +5016,15 @@ (defun org-find-invisible-foreground () (let ((candidates (remove "unspecified-bg" - (list - (face-background 'default) - (face-background 'org-default) - (cdr (assoc 'background-color default-frame-alist)) - (cdr (assoc 'background-color initial-frame-alist)) - (cdr (assoc 'background-color window-system-default-frame-alist)) - (face-foreground 'org-hide))))) + (nconc + (list (face-background 'default) + (face-background 'org-default)) + (mapcar + (lambda (alist) + (when (boundp alist) + (cdr (assoc 'background-color (symbol-value alist))))) + '(default-frame-alist initial-frame-alist window-system-default-frame-alist)) + (list (face-foreground 'org-hide)))))) (car (remove nil candidates)))) (defun org-current-time () @@ -5284,7 +5295,7 @@ (and move (backward-char 1)))) (defconst org-nonsticky-props - '(mouse-face highlight keymap invisible intangible help-echo org-linked-text)) + '(mouse-face highlight keymap invisible intangible help-echo org-linked-text htmlize-link)) (defsubst org-rear-nonsticky-at (pos) (add-text-properties (1- pos) pos (list 'rear-nonsticky org-nonsticky-props))) @@ -5293,12 +5304,13 @@ "Run through the buffer and add overlays to links." (catch 'exit (let (f) - (when (re-search-forward (concat org-plain-link-re) limit t) + (when (and (re-search-forward (concat org-plain-link-re) limit t) + (not (org-in-src-block-p))) (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) (setq f (get-text-property (match-beginning 0) 'face)) - (if (or (eq f 'org-tag) - (and (listp f) (memq 'org-tag f))) - nil + (unless (or (org-in-src-block-p) + (eq f 'org-tag) + (and (listp f) (memq 'org-tag f))) (add-text-properties (match-beginning 0) (match-end 0) (list 'mouse-face 'highlight 'face 'org-link @@ -5410,9 +5422,9 @@ '(font-lock-fontified t invisible t) '(font-lock-fontified t face org-document-info-keyword))) (add-text-properties - (match-beginning 6) (match-end 6) + (match-beginning 6) (1+ (match-end 6)) (if (string-equal dc1 "+title:") - '(font-lock-fontified t face org-document-title) + '(font-lock-fontified t face org-document-title) '(font-lock-fontified t face org-document-info)))) ((or (equal dc1 "+results") (member dc1 '("+begin:" "+end:" "+caption:" "+label:" @@ -5437,7 +5449,8 @@ (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) + (if (and (re-search-forward org-angle-link-re limit t) + (not (org-in-src-block-p))) (progn (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) (add-text-properties (match-beginning 0) (match-end 0) @@ -5465,7 +5478,8 @@ (defun org-activate-bracket-links (limit) "Run through the buffer and add overlays to bracketed links." - (if (re-search-forward org-bracket-link-regexp limit t) + (if (and (re-search-forward org-bracket-link-regexp limit t) + (not (org-in-src-block-p))) (let* ((help (concat "LINK: " (org-match-string-no-properties 1))) ;; FIXME: above we should remove the escapes. @@ -6254,11 +6268,7 @@ (setq has-children (org-list-has-child-p (point) struct))) (org-back-to-heading) (setq eoh (save-excursion (outline-end-of-heading) (point))) - (setq eos (save-excursion - (org-end-of-subtree t) - (unless (eobp) - (skip-chars-forward " \t\n")) - (if (eobp) (point) (1- (point))))) + (setq eos (save-excursion (1- (org-end-of-subtree t t)))) (setq has-children (or (save-excursion (let ((level (funcall outline-level))) @@ -6283,7 +6293,8 @@ (cond ((= eos eoh) ;; Nothing is hidden behind this heading - (run-hook-with-args 'org-pre-cycle-hook 'empty) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'empty)) (message "EMPTY ENTRY") (setq org-cycle-subtree-status nil) (save-excursion @@ -6296,7 +6307,8 @@ (not (setq children-skipped org-cycle-skip-children-state-if-no-children)))) ;; Entire subtree is hidden in one line: children view - (run-hook-with-args 'org-pre-cycle-hook 'children) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'children)) (if (org-at-item-p) (org-list-set-item-visibility (point-at-bol) struct 'children) (org-show-entry) @@ -6324,24 +6336,28 @@ (outline-next-heading) (if (outline-invisible-p) (org-flag-heading nil))) (setq org-cycle-subtree-status 'children) - (run-hook-with-args 'org-cycle-hook 'children)) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'children))) ((or children-skipped (and (eq last-command this-command) (eq org-cycle-subtree-status 'children))) ;; We just showed the children, or no children are there, ;; now show everything. - (run-hook-with-args 'org-pre-cycle-hook 'subtree) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'subtree)) (outline-flag-region eoh eos nil) (message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) (setq org-cycle-subtree-status 'subtree) - (run-hook-with-args 'org-cycle-hook 'subtree)) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'subtree))) (t ;; Default action: hide the subtree. (run-hook-with-args 'org-pre-cycle-hook 'folded) (outline-flag-region eoh eos t) (message "FOLDED") (setq org-cycle-subtree-status 'folded) - (run-hook-with-args 'org-cycle-hook 'folded))))) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'folded)))))) ;;;###autoload (defun org-global-cycle (&optional arg) @@ -6745,42 +6761,47 @@ (defvar org-goto-window-configuration nil) (defvar org-goto-marker nil) -(defvar org-goto-map - (let ((map (make-sparse-keymap))) - (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command mouse-drag-region universal-argument org-occur)) cmd) - (while (setq cmd (pop cmds)) - (substitute-key-definition cmd cmd map global-map))) - (suppress-keymap map) - (org-defkey map "\C-m" 'org-goto-ret) - (org-defkey map [(return)] 'org-goto-ret) - (org-defkey map [(left)] 'org-goto-left) - (org-defkey map [(right)] 'org-goto-right) - (org-defkey map [(control ?g)] 'org-goto-quit) - (org-defkey map "\C-i" 'org-cycle) - (org-defkey map [(tab)] 'org-cycle) - (org-defkey map [(down)] 'outline-next-visible-heading) - (org-defkey map [(up)] 'outline-previous-visible-heading) - (if org-goto-auto-isearch - (if (fboundp 'define-key-after) - (define-key-after map [t] 'org-goto-local-auto-isearch) - nil) - (org-defkey map "q" 'org-goto-quit) - (org-defkey map "n" 'outline-next-visible-heading) - (org-defkey map "p" 'outline-previous-visible-heading) - (org-defkey map "f" 'outline-forward-same-level) - (org-defkey map "b" 'outline-backward-same-level) - (org-defkey map "u" 'outline-up-heading)) - (org-defkey map "/" 'org-occur) - (org-defkey map "\C-c\C-n" 'outline-next-visible-heading) - (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading) - (org-defkey map "\C-c\C-f" 'outline-forward-same-level) - (org-defkey map "\C-c\C-b" 'outline-backward-same-level) - (org-defkey map "\C-c\C-u" 'outline-up-heading) - map)) +(defvar org-goto-map) +(defun org-goto-map () + "Set the keymap `org-goto'." + (setq org-goto-map + (let ((map (make-sparse-keymap))) + (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command + mouse-drag-region universal-argument org-occur)) + cmd) + (while (setq cmd (pop cmds)) + (substitute-key-definition cmd cmd map global-map))) + (suppress-keymap map) + (org-defkey map "\C-m" 'org-goto-ret) + (org-defkey map [(return)] 'org-goto-ret) + (org-defkey map [(left)] 'org-goto-left) + (org-defkey map [(right)] 'org-goto-right) + (org-defkey map [(control ?g)] 'org-goto-quit) + (org-defkey map "\C-i" 'org-cycle) + (org-defkey map [(tab)] 'org-cycle) + (org-defkey map [(down)] 'outline-next-visible-heading) + (org-defkey map [(up)] 'outline-previous-visible-heading) + (if org-goto-auto-isearch + (if (fboundp 'define-key-after) + (define-key-after map [t] 'org-goto-local-auto-isearch) + nil) + (org-defkey map "q" 'org-goto-quit) + (org-defkey map "n" 'outline-next-visible-heading) + (org-defkey map "p" 'outline-previous-visible-heading) + (org-defkey map "f" 'outline-forward-same-level) + (org-defkey map "b" 'outline-backward-same-level) + (org-defkey map "u" 'outline-up-heading)) + (org-defkey map "/" 'org-occur) + (org-defkey map "\C-c\C-n" 'outline-next-visible-heading) + (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading) + (org-defkey map "\C-c\C-f" 'outline-forward-same-level) + (org-defkey map "\C-c\C-b" 'outline-backward-same-level) + (org-defkey map "\C-c\C-u" 'outline-up-heading) + map))) (defconst org-goto-help - "Browse buffer copy, to find location or copy text. Just type for auto-isearch. -RET=jump to location [Q]uit and return to previous location + "Browse buffer copy, to find location or copy text.%s +RET=jump to location C-g=quit and return to previous location \[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur") (defvar org-goto-start-pos) ; dynamically scoped parameter @@ -6806,6 +6827,7 @@ With a prefix argument, use the alternative interface: e.g. if `org-goto-interface' is 'outline use 'outline-path-completion." (interactive "P") + (org-goto-map) (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level)))) (org-refile-use-outline-path t) (org-refile-target-verify-function nil) @@ -6838,48 +6860,46 @@ "Let the user select a location in the Org-mode buffer BUF. This function uses a recursive edit. It returns the selected position or nil." - (let ((isearch-mode-map org-goto-local-auto-isearch-map) - (isearch-hide-immediately nil) - (isearch-search-fun-function - (lambda () 'org-goto-local-search-headings)) - (org-goto-selected-point org-goto-exit-command) - (pop-up-frames nil) - (special-display-buffer-names nil) - (special-display-regexps nil) - (special-display-function nil)) - (save-excursion - (save-window-excursion - (delete-other-windows) - (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) - (org-pop-to-buffer-same-window - (condition-case nil - (make-indirect-buffer (current-buffer) "*org-goto*") - (error (make-indirect-buffer (current-buffer) "*org-goto*")))) - (with-output-to-temp-buffer "*Help*" - (princ help)) - (org-fit-window-to-buffer (get-buffer-window "*Help*")) - (setq buffer-read-only nil) - (let ((org-startup-truncated t) - (org-startup-folded nil) - (org-startup-align-all-tables nil)) - (org-mode) - (org-overview)) - (setq buffer-read-only t) - (if (and (boundp 'org-goto-start-pos) - (integer-or-marker-p org-goto-start-pos)) - (let ((org-show-hierarchy-above t) - (org-show-siblings t) - (org-show-following-heading t)) - (goto-char org-goto-start-pos) - (and (outline-invisible-p) (org-show-context))) - (goto-char (point-min))) - (let (org-special-ctrl-a/e) (org-beginning-of-line)) - (message "Select location and press RET") - (use-local-map org-goto-map) - (recursive-edit) - )) - (kill-buffer "*org-goto*") - (cons org-goto-selected-point org-goto-exit-command))) + (org-no-popups + (let ((isearch-mode-map org-goto-local-auto-isearch-map) + (isearch-hide-immediately nil) + (isearch-search-fun-function + (lambda () 'org-goto-local-search-headings)) + (org-goto-selected-point org-goto-exit-command)) + (save-excursion + (save-window-excursion + (delete-other-windows) + (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) + (org-pop-to-buffer-same-window + (condition-case nil + (make-indirect-buffer (current-buffer) "*org-goto*") + (error (make-indirect-buffer (current-buffer) "*org-goto*")))) + (with-output-to-temp-buffer "*Org Help*" + (princ (format help (if org-goto-auto-isearch + " Just type for auto-isearch." + " n/p/f/b/u to navigate, q to quit.")))) + (org-fit-window-to-buffer (get-buffer-window "*Org Help*")) + (setq buffer-read-only nil) + (let ((org-startup-truncated t) + (org-startup-folded nil) + (org-startup-align-all-tables nil)) + (org-mode) + (org-overview)) + (setq buffer-read-only t) + (if (and (boundp 'org-goto-start-pos) + (integer-or-marker-p org-goto-start-pos)) + (let ((org-show-hierarchy-above t) + (org-show-siblings t) + (org-show-following-heading t)) + (goto-char org-goto-start-pos) + (and (outline-invisible-p) (org-show-context))) + (goto-char (point-min))) + (let (org-special-ctrl-a/e) (org-beginning-of-line)) + (message "Select location and press RET") + (use-local-map org-goto-map) + (recursive-edit))) + (kill-buffer "*org-goto*") + (cons org-goto-selected-point org-goto-exit-command)))) (defvar org-goto-local-auto-isearch-map (make-sparse-keymap)) (set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map) @@ -7382,12 +7402,7 @@ ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2)))))) (max 1 (+ level (or change 0))))) -(if (boundp 'define-obsolete-function-alias) - (if (or (featurep 'xemacs) (< emacs-major-version 23)) - (define-obsolete-function-alias 'org-get-legal-level - 'org-get-valid-level) - (define-obsolete-function-alias 'org-get-legal-level - 'org-get-valid-level "23.1"))) +(org-define-obsolete-function-alias 'org-get-legal-level 'org-get-valid-level "23.1") (defvar org-called-with-limited-levels nil) ;; Dynamically bound in ;; Ì€org-with-limited-levels' @@ -7672,7 +7687,6 @@ (if (org-called-interactively-p 'any) (org-back-to-heading nil) ; take what looks like a subtree (org-back-to-heading t)) ; take what is really there - (org-back-over-empty-lines) (setq beg (point)) (skip-chars-forward " \t\r\n") (save-match-data @@ -7682,7 +7696,6 @@ (org-forward-heading-same-level (1- n) t) (error nil)) (org-end-of-subtree t t)) - (org-back-over-empty-lines) (setq end (point)) (goto-char beg0) (when (> end beg) @@ -7773,7 +7786,6 @@ (delete-region (point-at-bol) (point))) ;; Paste (beginning-of-line (if (bolp) 1 2)) - (unless for-yank (org-back-over-empty-lines)) (setq beg (point)) (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) (insert-before-markers txt) @@ -8630,6 +8642,24 @@ (put-text-property beg end 'org-category-position beg) (goto-char pos))))))) +(defun org-refresh-properties (dprop tprop) + "Refresh buffer text properties. +DPROP is the drawer property and TPROP is the corresponding text +property to set." + (let ((case-fold-search t) + (inhibit-read-only t) p) + (org-unmodified + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (re-search-forward (concat "^[ \t]*:" dprop ": +\\(.*\\)[ \t]*$") nil t) + (setq p (org-match-string-no-properties 1)) + (save-excursion + (org-back-to-heading t) + (put-text-property + (point-at-bol) (point-at-eol) tprop p)))))))) + ;;;; Link Stuff @@ -8723,7 +8753,7 @@ (push (list type follow export) org-link-protocols))) (defvar org-agenda-buffer-name) ; Defined in org-agenda.el -(defvar org-link-to-org-use-id) ; Defined in org-id.el +(defvar org-id-link-to-org-use-id) ; Defined in org-id.el ;;;###autoload (defun org-store-link (arg) @@ -8839,13 +8869,13 @@ "::" (match-string 1)) link cpltxt)) ((and (featurep 'org-id) - (or (eq org-link-to-org-use-id t) + (or (eq org-id-link-to-org-use-id t) (and (org-called-interactively-p 'any) - (or (eq org-link-to-org-use-id 'create-if-interactive) - (and (eq org-link-to-org-use-id + (or (eq org-id-link-to-org-use-id 'create-if-interactive) + (and (eq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) (not custom-id)))) - (and org-link-to-org-use-id (org-entry-get nil "ID")))) + (and org-id-link-to-org-use-id (org-entry-get nil "ID")))) ;; We can make a link using the ID. (setq link (condition-case nil (prog1 (org-id-store-link) @@ -9318,10 +9348,11 @@ ;; URL-like link, normalize the use of angular brackets. (setq link (org-remove-angle-brackets link))) - ;; Check if we are linking to the current file with a search option - ;; If yes, simplify the link by using only the search option. + ;; Check if we are linking to the current file with a search + ;; option If yes, simplify the link by using only the search + ;; option. (when (and buffer-file-name - (string-match "^file:\\(.+?\\)::\\([^>]+\\)" link)) + (string-match "^file:\\(.+?\\)::\\(.+\\)" link)) (let* ((path (match-string 1 link)) (case-fold-search nil) (search (match-string 2 link))) @@ -9652,7 +9683,13 @@ org-angle-link-re "\\|" "[ \t]:[^ \t\n]+:[ \t]*$"))) (not (get-text-property (point) 'org-linked-text))) - (or (org-offer-links-in-entry arg) + (or (let* ((lkall (org-offer-links-in-entry (current-buffer) (point) arg)) + (lk (car lkall)) + (lkend (cdr lkall))) + (when lk + (prog1 (search-forward lk nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point)))) (progn (require 'org-attach) (org-attach-reveal 'if-exists)))) ((run-hook-with-args-until-success 'org-open-at-point-functions)) ((and (org-at-timestamp-p t) @@ -9695,12 +9732,13 @@ (throw 'match t)) (save-excursion - (when (or (org-in-regexp org-angle-link-re) - (and (goto-char (car (org-in-regexp org-plain-link-re))) - (save-match-data (not (looking-back "\\[\\["))))) - (setq type (match-string 1) - path (org-link-unescape (match-string 2))) - (throw 'match t))) + (let ((plinkpos (org-in-regexp org-plain-link-re))) + (when (or (org-in-regexp org-angle-link-re) + (and plinkpos (goto-char (car plinkpos)) + (save-match-data (not (looking-back "\\[\\["))))) + (setq type (match-string 1) + path (org-link-unescape (match-string 2))) + (throw 'match t)))) (save-excursion (when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ \t]*$")) (setq type "tags" @@ -9713,7 +9751,7 @@ path (match-string 1)) (throw 'match t))) (unless path - (error "No link found")) + (user-error "No link found")) ;; switch back to reference buffer ;; needed when if called in a temporary buffer through @@ -9847,68 +9885,67 @@ (move-marker org-open-link-marker nil) (run-hook-with-args 'org-follow-link-hook))) -(defun org-offer-links-in-entry (&optional nth zero) - "Offer links in the current entry and follow the selected link. -If there is only one link, follow it immediately as well. -If NTH is an integer, immediately pick the NTH link found. +(defun org-offer-links-in-entry (buffer marker &optional nth zero) + "Offer links in the current entry and return the selected link. +If there is only one link, return it. +If NTH is an integer, return the NTH link found. If ZERO is a string, check also this string for a link, and if -there is one, offer it as link number zero." - (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|" - "\\(" org-angle-link-re "\\)\\|" - "\\(" org-plain-link-re "\\)")) - (cnt ?0) - (in-emacs (if (integerp nth) nil nth)) - have-zero end links link c) - (when (and (stringp zero) (string-match org-bracket-link-regexp zero)) - (push (match-string 0 zero) links) - (setq cnt (1- cnt) have-zero t)) +there is one, return it." + (with-current-buffer buffer (save-excursion - (org-back-to-heading t) - (setq end (save-excursion (outline-next-heading) (point))) - (while (re-search-forward re end t) - (push (match-string 0) links)) - (setq links (org-uniquify (reverse links)))) - - (cond - ((null links) - (message "No links")) - ((equal (length links) 1) - (setq link (list (car links)))) - ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth))) - (setq link (list (nth (if have-zero nth (1- nth)) links)))) - (t ; we have to select a link - (save-excursion - (save-window-excursion - (delete-other-windows) - (with-output-to-temp-buffer "*Select Link*" - (mapc (lambda (l) - (if (not (string-match org-bracket-link-regexp l)) - (princ (format "[%c] %s\n" (incf cnt) - (org-remove-angle-brackets l))) - (if (match-end 3) - (princ (format "[%c] %s (%s)\n" (incf cnt) - (match-string 3 l) (match-string 1 l))) - (princ (format "[%c] %s\n" (incf cnt) - (match-string 1 l)))))) - links)) - (org-fit-window-to-buffer (get-buffer-window "*Select Link*")) - (message "Select link to open, RET to open all:") - (setq c (read-char-exclusive)) - (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))) - (when (equal c ?q) (error "Abort")) - (if (equal c ?\C-m) - (setq link links) - (setq nth (- c ?0)) - (if have-zero (setq nth (1+ nth))) - (unless (and (integerp nth) (>= (length links) nth)) - (error "Invalid link selection")) - (setq link (list (nth (1- nth) links)))))) - (if link - (let ((buf (current-buffer))) - (dolist (l link) - (org-open-link-from-string l in-emacs buf)) - t) - nil))) + (save-restriction + (widen) + (goto-char marker) + (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|" + "\\(" org-angle-link-re "\\)\\|" + "\\(" org-plain-link-re "\\)")) + (cnt ?0) + (in-emacs (if (integerp nth) nil nth)) + have-zero end links link c) + (when (and (stringp zero) (string-match org-bracket-link-regexp zero)) + (push (match-string 0 zero) links) + (setq cnt (1- cnt) have-zero t)) + (save-excursion + (org-back-to-heading t) + (setq end (save-excursion (outline-next-heading) (point))) + (while (re-search-forward re end t) + (push (match-string 0) links)) + (setq links (org-uniquify (reverse links)))) + (cond + ((null links) + (message "No links")) + ((equal (length links) 1) + (setq link (car links))) + ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth))) + (setq link (nth (if have-zero nth (1- nth)) links))) + (t ; we have to select a link + (save-excursion + (save-window-excursion + (delete-other-windows) + (with-output-to-temp-buffer "*Select Link*" + (mapc (lambda (l) + (if (not (string-match org-bracket-link-regexp l)) + (princ (format "[%c] %s\n" (incf cnt) + (org-remove-angle-brackets l))) + (if (match-end 3) + (princ (format "[%c] %s (%s)\n" (incf cnt) + (match-string 3 l) (match-string 1 l))) + (princ (format "[%c] %s\n" (incf cnt) + (match-string 1 l)))))) + links)) + (org-fit-window-to-buffer (get-buffer-window "*Select Link*")) + (message "Select link to open, RET to open all:") + (setq c (read-char-exclusive)) + (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))) + (when (equal c ?q) (error "Abort")) + (if (equal c ?\C-m) + (setq link links) + (setq nth (- c ?0)) + (if have-zero (setq nth (1+ nth))) + (unless (and (integerp nth) (>= (length links) nth)) + (error "Invalid link selection")) + (setq link (nth (1- nth) links))))) + (cons link end)))))) ;; Add special file links that specify the way of opening @@ -9930,12 +9967,6 @@ '(add-hook 'org-export-preprocess-before-normalizing-links-hook 'org-remove-file-link-modifiers)) -;;;; Time estimates - -(defun org-get-effort (&optional pom) - "Get the effort estimate for the current entry." - (org-entry-get pom org-effort-property)) - ;;; File search (defvar org-create-file-search-functions nil @@ -11259,8 +11290,7 @@ " +" t))) (defcustom org-structure-template-alist - '( - ("s" "#+BEGIN_SRC ?\n\n#+END_SRC" + '(("s" "#+BEGIN_SRC ?\n\n#+END_SRC" "\n\n") ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE" "\n?\n") @@ -11268,6 +11298,8 @@ "\n?\n") ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE" "\n?\n") + ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM" + "\n?\n") ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER" "
\n?\n
") ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX" @@ -11283,8 +11315,7 @@ ("i" "#+INDEX: ?" "#+INDEX: ?") ("I" "#+INCLUDE: %file ?" - "") - ) + "")) "Structure completion elements. This is a list of abbreviation keys and values. The value gets inserted if you type `<' followed by the key and then press the completion key, @@ -11439,7 +11470,8 @@ cl (if (outline-invisible-p) (org-end-of-subtree nil t)))) (if (equal arg '(16)) (setq arg 'nextset)) (let ((org-blocker-hook org-blocker-hook) - (case-fold-search nil)) + commentp + case-fold-search) (when (equal arg '(64)) (setq arg nil org-blocker-hook nil)) (when (and org-blocker-hook @@ -11449,6 +11481,9 @@ (save-excursion (catch 'exit (org-back-to-heading t) + (when (looking-at (concat "^\\*+ " org-comment-string)) + (org-toggle-comment) + (setq commentp t)) (if (looking-at org-outline-regexp) (goto-char (1- (match-end 0)))) (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)")) (looking-at "\\(?: *\\|[ \t]*$\\)")) @@ -11624,7 +11659,8 @@ (and (looking-at " ") (just-one-space)))) (when org-trigger-hook (save-excursion - (run-hook-with-args 'org-trigger-hook change-plist))))))))) + (run-hook-with-args 'org-trigger-hook change-plist))) + (when commentp (org-toggle-comment)))))))) (defun org-block-todo-from-children-or-siblings-or-parent (change-plist) "Block turning an entry into a TODO, using the hierarchy. @@ -11765,15 +11801,16 @@ (defun org-entry-blocked-p () "Is the current entry blocked?" - (if (org-entry-get nil "NOBLOCKING") - nil ;; Never block this entry - (not - (run-hook-with-args-until-failure - 'org-blocker-hook - (list :type 'todo-state-change - :position (point) - :from 'todo - :to 'done))))) + (org-with-buffer-modified-unmodified + (if (org-entry-get nil "NOBLOCKING") + nil ;; Never block this entry + (not + (run-hook-with-args-until-failure + 'org-blocker-hook + (list :type 'todo-state-change + :position (point) + :from 'todo + :to 'done)))))) (defun org-update-statistics-cookies (all) "Update the statistics cookie, either from TODO or from checkboxes. @@ -11785,7 +11822,7 @@ (org-map-entries 'org-update-parent-todo-statistics)) (if (not (org-at-heading-p)) (org-update-checkbox-count) - (let ((pos (move-marker (make-marker) (point))) + (let ((pos (point-marker)) end l1 l2) (ignore-errors (org-back-to-heading t)) (if (not (org-at-heading-p)) @@ -12666,7 +12703,7 @@ (let (ans kwd value ts-type) (setq type (or type org-sparse-tree-default-date-type)) (setq org-ts-type type) - (message "Sparse tree: [r]egexp [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n [d]eadlines [b]efore-date [a]fter-date [D]ates range\n [c]ycle through date types: %s" + (message "Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n [d]eadlines [b]efore-date [a]fter-date [D]ates range\n [c]ycle through date types: %s" (cond ((eq type 'all) "all timestamps") ((eq type 'scheduled) "only scheduled") ((eq type 'deadline) "only deadline") @@ -12981,9 +13018,9 @@ (defun org-get-priority (s) "Find priority cookie and return priority." - (if (functionp org-get-priority-function) - (funcall org-get-priority-function) - (save-match-data + (save-match-data + (if (functionp org-get-priority-function) + (funcall org-get-priority-function) (if (not (string-match org-priority-regexp s)) (* 1000 (- org-lowest-priority org-default-priority)) (* 1000 (- org-lowest-priority @@ -13113,18 +13150,9 @@ (or (not todo-only) (and (member todo org-not-done-keywords) (or (not org-agenda-tags-todo-honor-ignore-options) - (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))))) - - ;; Extra check for the archive tag - ;; FIXME: Does the skipper already do this???? - (or - (not (member org-archive-tag tags-list)) - ;; we have an archive tag, should we use this anyway? - (or (not org-agenda-skip-archived-trees) - (and (eq action 'agenda) org-agenda-archives-mode)))) + (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))))) ;; select this headline - (cond ((eq action 'sparse-tree) (and org-highlight-sparse-tree-matches @@ -14276,6 +14304,9 @@ existing nil nil "" nil cur)))))) (unless (equal (org-entry-get nil prop) val) (org-entry-put nil prop val)) + (save-excursion + (org-back-to-heading t) + (put-text-property (point-at-bol) (point-at-eol) 'org-effort val)) (message "%s is now %s" prop val))) (defun org-at-property-p () @@ -14454,26 +14485,27 @@ ;; We need a special property. Use `org-entry-properties' to ;; retrieve it, but specify the wanted property (cdr (assoc property (org-entry-properties nil 'special property))) - (let* ((range (org-get-property-block)) - (props (list (or (assoc property org-file-properties) - (assoc property org-global-properties) - (assoc property org-global-properties-fixed)))) - (ap (lambda (key) - (when (re-search-forward - (org-re-property key) (cdr range) t) - (setq props - (org-update-property-plist - key - (if (match-end 1) - (org-match-string-no-properties 1) "") - props))))) - val) - (when (and range (goto-char (car range))) - (funcall ap property) - (goto-char (car range)) - (while (funcall ap (concat property "+"))) - (setq val (cdr (assoc property props))) - (when val (if literal-nil val (org-not-nil val))))))))) + (let ((range (org-get-property-block))) + (when (and range (not (eq (car range) (cdr range)))) + (let* ((props (list (or (assoc property org-file-properties) + (assoc property org-global-properties) + (assoc property org-global-properties-fixed)))) + (ap (lambda (key) + (when (re-search-forward + (org-re-property key) (cdr range) t) + (setq props + (org-update-property-plist + key + (if (match-end 1) + (org-match-string-no-properties 1) "") + props))))) + val) + (goto-char (car range)) + (funcall ap property) + (goto-char (car range)) + (while (funcall ap (concat property "+"))) + (setq val (cdr (assoc property props))) + (when val (if literal-nil val (org-not-nil val)))))))))) (defun org-property-or-variable-value (var &optional inherit) "Check if there is a property fixing the value of VAR. @@ -14996,7 +15028,8 @@ (interactive) (unless (org-at-property-p) (error "Not at a property")) - (let* ((key (match-string 2)) + (let* ((prop (car (save-match-data (org-split-string (match-string 1) ":")))) + (key (match-string 2)) (value (match-string 3)) (allowed (or (org-property-get-allowed-values (point) key) (and (member value '("[ ]" "[-]" "[X]")) @@ -15015,6 +15048,10 @@ (org-indent-line) (beginning-of-line 1) (skip-chars-forward " \t") + (when (equal prop org-effort-property) + (save-excursion + (org-back-to-heading t) + (put-text-property (point-at-bol) (point-at-eol) 'org-effort nval))) (run-hook-with-args 'org-property-changed-functions key nval))) (defun org-find-olp (path &optional this-buffer) @@ -15060,7 +15097,7 @@ (setq lmin (1+ flevel) lmax (+ lmin (if org-odd-levels-only 1 0))) (setq end (save-excursion (org-end-of-subtree t t)))) (when (org-at-heading-p) - (move-marker (make-marker) (point)))))))) + (point-marker))))))) (defun org-find-exact-headline-in-buffer (heading &optional buffer pos-only) "Find node HEADING in BUFFER. @@ -15307,6 +15344,7 @@ (setcar (nthcdr 1 org-defdecode) 59) (setq org-def (apply 'encode-time org-defdecode) org-defdecode (decode-time org-def))))) + (mouse-autoselect-window nil) ; Don't let the mouse jump (calendar-frame-setup nil) (calendar-setup nil) (calendar-move-hook nil) @@ -16966,6 +17004,8 @@ (widen) (setq bmp (buffer-modified-p)) (org-refresh-category-properties) + (org-refresh-properties org-effort-property 'org-effort) + (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime) (setq org-todo-keywords-for-agenda (append org-todo-keywords-for-agenda org-todo-keywords-1)) (setq org-done-keywords-for-agenda @@ -17758,7 +17798,7 @@ (list 'org-display-inline-remove-overlay)) (push ov org-inline-image-overlays))))))))) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-display-inline-modification-hook 'org-display-inline-remove-overlay "24.3") (defun org-display-inline-remove-overlay (ov after beg end &optional len) @@ -18053,7 +18093,7 @@ ("c" . org-cycle) ("C" . org-shifttab) (" " . org-display-outline-path) - (":" . org-columns) + ("=" . org-columns) ("Outline Structure Editing") ("U" . org-shiftmetaup) ("D" . org-shiftmetadown) @@ -18078,7 +18118,7 @@ ("1" . (org-priority ?A)) ("2" . (org-priority ?B)) ("3" . (org-priority ?C)) - (";" . org-set-tags-command) + (":" . org-set-tags-command) ("e" . org-set-effort) ("E" . org-inc-effort) ("W" . (lambda(m) (interactive "sMinutes before warning: ") @@ -18138,7 +18178,7 @@ (defvar org-table-auto-blank-field) ; defined in org-table.el (defvar org-speed-command nil) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-speed-command-default-hook 'org-speed-command-activate "24.3") (defun org-speed-command-activate (keys) @@ -18151,7 +18191,7 @@ (cdr (assoc keys (append org-speed-commands-user org-speed-commands-default))))) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-babel-speed-command-hook 'org-babel-speed-command-activate "24.3") (defun org-babel-speed-command-activate (keys) @@ -18296,25 +18336,26 @@ still be marked for re-alignment if the field did fill the entire column, because, in this case the deletion might narrow the column." (interactive "p") - (org-check-before-invisible-edit 'delete-backward) - (if (and (org-table-p) - (eq N 1) - (string-match "|" (buffer-substring (point-at-bol) (point))) - (looking-at ".*?|")) - (let ((pos (point)) - (noalign (looking-at "[^|\n\r]* |")) - (c org-table-may-need-update)) - (backward-delete-char N) - (if (not overwrite-mode) - (progn - (skip-chars-forward "^|") - (insert " ") - (goto-char (1- pos)))) - ;; noalign: if there were two spaces at the end, this field - ;; does not determine the width of the column. - (if noalign (setq org-table-may-need-update c))) - (backward-delete-char N) - (org-fix-tags-on-the-fly))) + (save-match-data + (org-check-before-invisible-edit 'delete-backward) + (if (and (org-table-p) + (eq N 1) + (string-match "|" (buffer-substring (point-at-bol) (point))) + (looking-at ".*?|")) + (let ((pos (point)) + (noalign (looking-at "[^|\n\r]* |")) + (c org-table-may-need-update)) + (backward-delete-char N) + (if (not overwrite-mode) + (progn + (skip-chars-forward "^|") + (insert " ") + (goto-char (1- pos)))) + ;; noalign: if there were two spaces at the end, this field + ;; does not determine the width of the column. + (if noalign (setq org-table-may-need-update c))) + (backward-delete-char N) + (org-fix-tags-on-the-fly)))) (defun org-delete-char (N) "Like `delete-char', but insert whitespace at field end in tables. @@ -18323,25 +18364,26 @@ still be marked for re-alignment if the field did fill the entire column, because, in this case the deletion might narrow the column." (interactive "p") - (org-check-before-invisible-edit 'delete) - (if (and (org-table-p) - (not (bolp)) - (not (= (char-after) ?|)) - (eq N 1)) - (if (looking-at ".*?|") - (let ((pos (point)) - (noalign (looking-at "[^|\n\r]* |")) - (c org-table-may-need-update)) - (replace-match (concat - (substring (match-string 0) 1 -1) - " |")) - (goto-char pos) - ;; noalign: if there were two spaces at the end, this field - ;; does not determine the width of the column. - (if noalign (setq org-table-may-need-update c))) - (delete-char N)) - (delete-char N) - (org-fix-tags-on-the-fly))) + (save-match-data + (org-check-before-invisible-edit 'delete) + (if (and (org-table-p) + (not (bolp)) + (not (= (char-after) ?|)) + (eq N 1)) + (if (looking-at ".*?|") + (let ((pos (point)) + (noalign (looking-at "[^|\n\r]* |")) + (c org-table-may-need-update)) + (replace-match (concat + (substring (match-string 0) 1 -1) + " |")) + (goto-char pos) + ;; noalign: if there were two spaces at the end, this field + ;; does not determine the width of the column. + (if noalign (setq org-table-may-need-update c))) + (delete-char N)) + (delete-char N) + (org-fix-tags-on-the-fly)))) ;; Make `delete-selection-mode' work with org-mode and orgtbl-mode (put 'org-self-insert-command 'delete-selection t) @@ -18956,15 +18998,22 @@ (org-table-paste-rectangle) (org-paste-subtree arg))) +(defsubst org-in-fixed-width-region-p () + "Is point in a fixed-width region?" + (save-match-data + (eq 'fixed-width (org-element-type (org-element-at-point))))) + (defun org-edit-special (&optional arg) "Call a special editor for the stuff at point. When at a table, call the formula editor with `org-table-edit-formulas'. -When at the first line of an src example, call `org-edit-src-code'. -When in an #+include line, visit the include file. Otherwise call -`ffap' to visit the file at point." +When in a source code block, call `org-edit-src-code'. +When in a fixed-width region, call `org-edit-fixed-width-region'. +When in an #+include line, visit the included file. +On a link, call `ffap' to visit the link at point. +Otherwise, return a user error." (interactive) ;; possibly prep session before editing source - (when arg + (when (and (org-in-src-block-p) arg) (let* ((info (org-babel-get-src-block-info)) (lang (nth 0 info)) (params (nth 2 info)) @@ -18977,16 +19026,17 @@ (beginning-of-line 1) (looking-at "\\(?:#\\+\\(?:setupfile\\|include\\):?[ \t]+\"?\\|[ \t]*.*?file=\"\\)\\([^\"\n>]+\\)")) (find-file (org-trim (match-string 1)))) - ((org-edit-src-code)) - ((org-edit-fixed-width-region)) - ((org-at-table.el-p) - (org-edit-src-code)) ((or (org-at-table-p) (save-excursion (beginning-of-line 1) (let ((case-fold-search )) (looking-at "[ \t]*#\\+tblfm:")))) (call-interactively 'org-table-edit-formulas)) - (t (call-interactively 'ffap)))) + ((or (org-in-block-p '("src" "example" "latex" "html")) + (org-at-table.el-p)) + (org-edit-src-code)) + ((org-in-fixed-width-region-p) (org-edit-fixed-width-region)) + ((org-at-regexp-p org-any-link-re) (call-interactively 'ffap)) + (t (user-error "No special environment to edit here")))) (defvar org-table-coordinate-overlays) ; defined in org-table.el (defun org-ctrl-c-ctrl-c (&optional arg) @@ -19103,8 +19153,10 @@ (org-list-struct-fix-ind struct parents) (setq block-item (org-list-struct-fix-box struct parents prevs orderedp))) - (org-list-struct-apply-struct struct old-struct) - (org-update-checkbox-count-maybe) + (if (equal struct old-struct) + (user-error "Cannot toggle this checkbox (unchecked subitems?)") + (org-list-struct-apply-struct struct old-struct) + (org-update-checkbox-count-maybe)) (when block-item (message "Checkboxes were removed due to unchecked box at line %d" @@ -20238,13 +20290,19 @@ "Is S an ID created by UUIDGEN?" (string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s))) -(defun org-in-src-block-p nil - "Whether point is in a code source block." - (let (ov) - (when (setq ov (overlays-at (point))) - (memq 'org-block-background - (overlay-properties - (car ov)))))) +(defun org-in-src-block-p (&optional inside) + "Whether point is in a code source block. +When INSIDE is non-nil, don't consider we are within a src block +when point is at #+BEGIN_SRC or #+END_SRC." + (let ((case-fold-search t) ov) + (or (and (setq ov (overlays-at (point))) + (memq 'org-block-background + (overlay-properties (car ov)))) + (and (not inside) + (save-match-data + (save-excursion + (beginning-of-line) + (looking-at ".*#\\+\\(begin\\|end\\)_src"))))))) (defun org-context () "Return a list of contexts of the current cursor position. @@ -20587,9 +20645,8 @@ "Switch to buffer in a second window on the current frame. In particular, do not allow pop-up frames. Returns the newly created buffer." - (let (pop-up-frames special-display-buffer-names special-display-regexps - special-display-function) - (apply 'switch-to-buffer-other-window args))) + (org-no-popups + (apply 'switch-to-buffer-other-window args))) (defun org-combine-plists (&rest plists) "Create a single property list from all plists in PLISTS. @@ -20768,6 +20825,7 @@ (t (beginning-of-line 0) (while (and (not (bobp)) + (not (looking-at org-table-line-regexp)) (not (looking-at org-drawer-regexp)) ;; When point started in an inline task, do not move ;; above task starting line. @@ -20898,6 +20956,7 @@ '(org-fill-paragraph-separate-nobreak-p org-fill-line-break-nobreak-p))))) (org-set-local 'fill-paragraph-function 'org-fill-paragraph) + (org-set-local 'auto-fill-inhibit-regexp nil) (org-set-local 'adaptive-fill-function 'org-adaptive-fill-function) (org-set-local 'normal-auto-fill-function 'org-auto-fill-function) (org-set-local 'comment-line-break-function 'org-comment-line-break-function)) @@ -20920,48 +20979,54 @@ "Compute a fill prefix for the current line. Return fill prefix, as a string, or nil if current line isn't meant to be filled." - (org-with-wide-buffer - (unless (and (derived-mode-p 'message-mode) (not (message-in-body-p))) - ;; FIXME: This is really the job of orgstruct++-mode - (let* ((p (line-beginning-position)) - (element (save-excursion (beginning-of-line) - (org-element-at-point))) - (type (org-element-type element)) - (post-affiliated - (save-excursion - (goto-char (org-element-property :begin element)) - (while (looking-at org-element--affiliated-re) (forward-line)) - (point)))) - (unless (< p post-affiliated) - (case type - (comment (looking-at "[ \t]*# ?") (match-string 0)) - (footnote-definition "") - ((item plain-list) - (make-string (org-list-item-body-column post-affiliated) ? )) - (paragraph - ;; Fill prefix is usually the same as the current line, - ;; except if the paragraph is at the beginning of an item. - (let ((parent (org-element-property :parent element))) - (cond ((eq (org-element-type parent) 'item) - (make-string (org-list-item-body-column - (org-element-property :begin parent)) - ? )) - ((save-excursion (beginning-of-line) (looking-at "[ \t]+")) - (match-string 0)) - (t "")))) - (comment-block - ;; Only fill contents if P is within block boundaries. - (let* ((cbeg (save-excursion (goto-char post-affiliated) - (forward-line) - (point))) - (cend (save-excursion - (goto-char (org-element-property :end element)) - (skip-chars-backward " \r\t\n") - (line-beginning-position)))) - (when (and (>= p cbeg) (< p cend)) - (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) - (match-string 0) - "")))))))))) + (let (prefix) + (when (and (derived-mode-p 'message-mode) (message-in-body-p)) + (save-excursion + (beginning-of-line) + (cond ((looking-at message-cite-prefix-regexp) + (setq prefix (match-string-no-properties 0))) + ((looking-at org-outline-regexp) + (setq prefix ""))))) + (or prefix + (org-with-wide-buffer + (let* ((p (line-beginning-position)) + (element (save-excursion (beginning-of-line) (org-element-at-point))) + (type (org-element-type element)) + (post-affiliated + (save-excursion + (goto-char (org-element-property :begin element)) + (while (looking-at org-element--affiliated-re) (forward-line)) + (point)))) + (unless (< p post-affiliated) + (case type + (comment (looking-at "[ \t]*# ?") (match-string 0)) + (footnote-definition "") + ((item plain-list) + (make-string (org-list-item-body-column post-affiliated) ? )) + (paragraph + ;; Fill prefix is usually the same as the current line, + ;; except if the paragraph is at the beginning of an item. + (let ((parent (org-element-property :parent element))) + (cond ((eq (org-element-type parent) 'item) + (make-string (org-list-item-body-column + (org-element-property :begin parent)) + ? )) + ((save-excursion (beginning-of-line) (looking-at "[ \t]+")) + (match-string 0)) + (t "")))) + (comment-block + ;; Only fill contents if P is within block boundaries. + (let* ((cbeg (save-excursion (goto-char post-affiliated) + (forward-line) + (point))) + (cend (save-excursion + (goto-char (org-element-property :end element)) + (skip-chars-backward " \r\t\n") + (line-beginning-position)))) + (when (and (>= p cbeg) (< p cend)) + (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) + (match-string 0) + ""))))))))))) (declare-function message-goto-body "message" ()) (defvar message-cite-prefix-regexp) ; From message.el @@ -20981,12 +21046,12 @@ For convenience, when point is at a plain list, an item or a footnote definition, try to fill the first paragraph within." - ;; Falls back on message-fill-paragraph when necessary (interactive) (if (and (derived-mode-p 'message-mode) (or (not (message-in-body-p)) (save-excursion (move-beginning-of-line 1) (looking-at message-cite-prefix-regexp)))) + ;; First ensure filling is correct in message-mode. (let ((fill-paragraph-function (cadadr (assoc 'fill-paragraph-function org-fb-vars))) (fill-prefix (cadadr (assoc 'fill-prefix org-fb-vars))) @@ -21003,6 +21068,8 @@ ;; the buffer. In that case, ignore filling. (if (< (point) (org-element-property :begin element)) t (case (org-element-type element) + ;; Use major mode filling function is src blocks. + (src-block (org-babel-do-key-sequence-in-edit-buffer (kbd "M-q"))) ;; Align Org tables, leave table.el tables as-is. (table-row (org-table-align) t) (table === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2013-01-02 16:13:04 +0000 +++ lisp/progmodes/compile.el 2013-01-09 08:30:21 +0000 @@ -1280,7 +1280,7 @@ ;; whether or not omake's own error messages are recognized. (cond ((not (memq 'omake compilation-error-regexp-alist)) nil) - ((string-match "\\`\\([^^]\\|^\\( \\*\\|\\[\\)\\)" pat) + ((string-match "\\`\\([^^]\\|\\^\\( \\*\\|\\[\\)\\)" pat) nil) ;; Not anchored or anchored but already allows empty spaces. (t (setq pat (concat "^ *" (substring pat 1))))) ------------------------------------------------------------ revno: 111455 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-01-09 00:25:11 -0800 message: Spelling fix merged from gnulib. diff: === modified file 'lib/strftime.c' --- lib/strftime.c 2013-01-08 05:07:19 +0000 +++ lib/strftime.c 2013-01-09 08:25:11 +0000 @@ -210,7 +210,7 @@ else \ { \ /* Ignore the value of fwrite. The caller can determine whether \ - an error occured by inspecting ferror (P). All known fwrite \ + an error occurred by inspecting ferror (P). All known fwrite \ implementations set the stream's error indicator when they \ fail due to ENOMEM etc., even though C11 and POSIX.1-2008 do \ not require this. */ \ ------------------------------------------------------------ revno: 111454 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-01-09 00:17:47 -0800 message: Spelling fixes. * lisp/net/tramp-adb.el (tramp-adb-get-toolbox): Fix misspelling of 'unknown'. diff: === modified file 'doc/misc/htmlfontify.texi' --- doc/misc/htmlfontify.texi 2013-01-05 16:19:53 +0000 +++ doc/misc/htmlfontify.texi 2013-01-09 08:17:47 +0000 @@ -7,7 +7,7 @@ @copying This manual documents Htmlfontify, a source code -> crosslinked + -formatted + syntax colorised html transformer. +formatted + syntax colorized html transformer. Copyright @copyright{} 2002, 2003, 2013 Free Software Foundation, Inc. @@ -56,7 +56,7 @@ @menu * Introduction:: About Htmlfontify. * Usage & Examples:: How to use Htmlfontify. -* Customisation:: Fine-tuning Htmlfontify's behaviour. +* Customization:: Fine-tuning Htmlfontify's behaviour. * Requirements:: External programs used by Htmlfontify. * GNU Free Documentation License:: The license for this documentation. * Index:: Index of contents. @@ -68,7 +68,7 @@ Htmlfontify provides a means of converting individual Emacs buffers, source files, or entire source trees to html, preserving formatting -and Emacs colorisation / syntax highlighting as much as possible +and Emacs colorization / syntax highlighting as much as possible through careful application of CSS stylesheets and html tags. It can also turn instances of functions, methods and (for some @@ -76,7 +76,7 @@ to their definitions, and create an index file (or files) of all such symbols, also linked to their points of definition. -Htmlfontify also provides several customisation items, which should +Htmlfontify also provides several customization items, which should allow it to mesh more-or-less seamlessly with various templating or publishing systems (in the event, for instance, that you don't want to produce the html pages directly). @@ -93,7 +93,7 @@ @menu * Interactive:: Using Htmlfontify interactively. * Non-interactive:: Using Htmlfontify from elisp. -* Variables:: Variables (other than customisation entries). +* Variables:: Variables (other than customization entries). * Data Structures:: Important data structures. * Examples:: Example(s) of Htmlfontify in use. @end menu @@ -236,7 +236,7 @@ @end lisp Return a @code{defface} style alist of possible specifications for -@var{face}, with any entries resulting from user customisation +@var{face}, with any entries resulting from user customization (@code{custom-set-faces}) taking precedence. See also: @ref{hfy-default-face-def} @@ -268,10 +268,10 @@ exposed and rendered, or until Emacs is idle for a while. Sometimes, in non-interactive circumstances, or if it can't see X, it doesn't bother with some of the harder stuff. While this is all great from the perspective -of a user waiting for Emacs to load a 20000 line file and colorise it, +of a user waiting for Emacs to load a 20000 line file and colorize it, it's a pain from the point of view from non-interactive code. This function lies, cheats, steals and generally bullies Emacs into fontifying a buffer -from start to finish, with all the extra frills, whether it thinks it nneds +from start to finish, with all the extra frills, whether it thinks it needs to or not. Oh yes: it operates on the current buffer. @item hfy-link-style-string @@ -861,7 +861,7 @@ (hfy-kludge-cperl-mode) @end lisp -cperl mode does its damndest not to do some of its fontification when not +cperl mode does its best to not do some of its fontification when not in a windowing system---we try to trick it@dots{} @item hfy-href @@ -1044,7 +1044,7 @@ @section Variables @cindex variables -Important variables that are not customisation items: +Important variables that are not customization items: @table @code @@ -1234,7 +1234,7 @@ ;; Here's the function I actually call---it asks me for a section label, ;; and source and destination directories, and then binds a couple of -;; customisation variable in a let before calling htmlfontify: +;; customization variable in a let before calling htmlfontify: (defun rtfm-build-source-docs (section srcdir destdir) (interactive "s section[eg- emacs / p4-blame]:\nD source-dir: \nD output-dir: ") @@ -1252,11 +1252,11 @@ (htmlfontify-copy-and-link-dir srcdir destdir ".src" ".html"))) @end lisp -@node Customisation -@chapter Customisation -@cindex variables (customisation) +@node Customization +@chapter Customization +@cindex variables (customization) -Htmlfontify provides the following variable and customisation entries: +Htmlfontify provides the following variable and customization entries: @table @code @comment AUTOGENERATED BLOCK @@ -1394,7 +1394,7 @@ extracting potentially non-current face information doesn't necessarily work for @code{default}). -For example, I customise this to: +For example, I customize this to: @lisp ((t :background "black" :foreground "white" :family "misc-fixed")) @@ -1405,7 +1405,7 @@ @anchor{hfy-init-kludge-hooks} List of functions to call when starting htmlfontify-buffer to do any -kludging necessary to get highlighting modes to bahave as you want, even +kludging necessary to get highlighting modes to behave as you want, even when not running under a window system. @item hfy-shell-file-name @@ -1421,7 +1421,7 @@ @vindex hfy-optimisations @anchor{hfy-optimisations} -Optimisations to turn on. So far, the following have been implemented: +Optimizations to turn on. So far, the following have been implemented: @table @option @item merge-adjacent-tags @@ -1454,7 +1454,8 @@ @end table -Note: like compiler optimisations, these optimise the _output_ of the code, +Note: like compiler optimizations, these optimize the @emph{output} of +the code, not the processing of the source itself, and are therefore likely to slow Htmlfontify down, at least a little. Except for skip-refontification, which can never slow you down, but may result in incomplete fontification. @@ -1470,7 +1471,7 @@ @anchor{hfy-link-extn} File extension used for href links---useful where the Htmlfontify -output files are going to be processed again, with a rersulting change +output files are going to be processed again, with a resulting change in file extension. If @code{nil}, then any code using this should fall back to @ref{hfy-extn}. @@ -1570,16 +1571,16 @@ @item A copy of etags (exuberant-ctags or GNU etags). Htmlfontify attempts -to autodetect the version you have and customise itself accordingly, +to autodetect the version you have and customize itself accordingly, but you should be able to override this. -See: @ref{Customisation} +See: @ref{Customization} @item A copy of find (e.g., GNU find) that provides the @code{-path} predicate. You may be able to work around this with a suitable clever shell -command and the customisation entry: @ref{hfy-find-cmd} +command and the customization entry: @ref{hfy-find-cmd} @item A copy of sed (e.g., GNU sed). @@ -1603,7 +1604,7 @@ @item Functions @printindex fn -@item Variables & Customisation +@item Variables & Customization @printindex vr @end table === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-08 23:50:40 +0000 +++ lisp/ChangeLog 2013-01-09 08:17:47 +0000 @@ -1,3 +1,9 @@ +2013-01-09 Paul Eggert + + Spelling fixes. + * net/tramp-adb.el (tramp-adb-get-toolbox): + Fix misspelling of 'unknown'. + 2013-01-08 Juri Linkov * textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate): @@ -436,7 +442,7 @@ * net/tramp-adb.el (tramp-adb-get-ls-command): New defun. Suppress coloring, if possible (required for BusyBox based systems like - CynagenMod). + CyanogenMod). (tramp-adb-handle-file-attributes) (tramp-adb-handle-insert-directory) (tramp-adb-handle-file-name-all-completions): Use it. @@ -11609,7 +11615,7 @@ 2012-03-16 Alan Mackenzie - Further optimise the handling of large macros. + Further optimize the handling of large macros. * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Use a limit to a call of `c-literal-limits'. @@ -13261,7 +13267,7 @@ 2012-01-08 Alan Mackenzie - Optimise font locking in long enum definitions. + Optimize font locking in long enum definitions. * progmodes/cc-fonts.el (c-font-lock-declarations): Add an extra arm to a cond form to handle enums. === modified file 'lisp/net/tramp-adb.el' --- lisp/net/tramp-adb.el 2013-01-08 11:02:58 +0000 +++ lisp/net/tramp-adb.el 2013-01-09 08:17:47 +0000 @@ -372,14 +372,14 @@ "ls"))) (defun tramp-adb-get-toolbox (vec) - "Get shell toolbox implementation: `toolbox' for orginal distributions -or `busybox' for CynagenMode based distributions" + "Get shell toolbox implementation: `toolbox' for original distributions +or `busybox' for CyanogenMod based distributions" (with-tramp-connection-property vec "toolbox" (tramp-message vec 5 "Checking shell toolbox implementation") (cond ((zerop (tramp-adb-command-exit-status vec "busybox")) 'busybox) ((zerop (tramp-adb-command-exit-status vec "toolbox")) 'toolbox) - (t 'unkown)))) + (t 'unknown)))) (defun tramp-adb--gnu-switches-to-ash (switches) === modified file 'src/nsfns.m' --- src/nsfns.m 2013-01-02 16:13:04 +0000 +++ src/nsfns.m 2013-01-09 08:17:47 +0000 @@ -1503,12 +1503,12 @@ [panel setDelegate: fileDelegate]; panelOK = 0; - if (! NILP (dir_only_p)) + if (! NILP (dir_only_p)) { [panel setCanChooseDirectories: YES]; [panel setCanChooseFiles: NO]; } - + block_input (); #if defined (NS_IMPL_COCOA) && \ MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 @@ -1519,7 +1519,7 @@ [panel setNameFieldStringValue: [initS lastPathComponent]]; else [panel setNameFieldStringValue: @""]; - + ret = [panel runModal]; #else if (NILP (mustmatch) && NILP (dir_only_p)) @@ -2147,7 +2147,7 @@ [NSApp postEvent: nxev atStart: NO]; // If there are other events, the event loop may exit. Keep running - // until the script has been handeled. */ + // until the script has been handled. */ while (! NILP (as_script)) [NSApp run]; ------------------------------------------------------------ revno: 111453 committer: Daiki Ueno branch nick: trunk timestamp: Wed 2013-01-09 14:11:16 +0900 message: * mml-smime.el (epg-sub-key-fingerprint): Autoload. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-01-08 04:40:09 +0000 +++ lisp/gnus/ChangeLog 2013-01-09 05:11:16 +0000 @@ -1,3 +1,8 @@ +2013-01-09 Daiki Ueno + + * mml-smime.el (epg-sub-key-fingerprint): Autoload for + mml-smime-epg-find-usable-secret-key. + 2013-01-08 Glenn Morris * mml-smime.el (mml-smime-sign-with-sender): Add :version. === modified file 'lisp/gnus/mml-smime.el' --- lisp/gnus/mml-smime.el 2013-01-08 04:40:09 +0000 +++ lisp/gnus/mml-smime.el 2013-01-09 05:11:16 +0000 @@ -329,6 +329,7 @@ (autoload 'epg-encrypt-string "epg") (autoload 'epg-passphrase-callback-function "epg") (autoload 'epg-context-set-passphrase-callback "epg") + (autoload 'epg-sub-key-fingerprint "epg") (autoload 'epg-configuration "epg-config") (autoload 'epg-expand-group "epg-config") (autoload 'epa-select-keys "epa")) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.