commit 0a75af915653bd8927f92be420603725a7e3c744 (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Mon Jan 22 22:00:55 2018 -0500 * lisp/emacs-lisp/ert.el (describe-symbol-backends): Add ourselves (ert-describe-test): Return the description text as well. Remove left over version check. * lisp/help-mode.el (describe-symbol-backends): Add docstring. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 029a2939a0..a47108545d 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -2549,8 +2549,6 @@ To be used in the ERT results buffer." (defun ert-describe-test (test-or-test-name) "Display the documentation for TEST-OR-TEST-NAME (a symbol or ert-test)." (interactive (list (ert-read-test-name-at-point "Describe test"))) - (when (< emacs-major-version 24) - (user-error "Requires Emacs 24 or later")) (let (test-name test-definition) (cl-etypecase test-or-test-name @@ -2587,7 +2585,9 @@ To be used in the ERT results buffer." (insert (substitute-command-keys (or (ert-test-documentation test-definition) "It is not documented.")) - "\n"))))))) + "\n") + ;; For describe-symbol-backends. + (buffer-string))))))) (defun ert-results-describe-test-at-point () "Display the documentation of the test at point. @@ -2599,6 +2599,11 @@ To be used in the ERT results buffer." ;;; Actions on load/unload. +(require 'help-mode) +(add-to-list 'describe-symbol-backends + `("ERT test" ,#'ert-test-boundp + ,(lambda (s _b _f) (ert-describe-test s)))) + (add-to-list 'find-function-regexp-alist '(ert--test . ert--find-test-regexp)) (add-to-list 'minor-mode-alist '(ert--current-run-stats (:eval @@ -2613,7 +2618,7 @@ To be used in the ERT results buffer." 'ert--activate-font-lock-keywords) nil) -(defvar ert-unload-hook '()) +(defvar ert-unload-hook ()) (add-hook 'ert-unload-hook #'ert--unload-function) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index ee481cf43f..4fb3fb85c9 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -421,7 +421,15 @@ it does not already exist." (or (and (boundp symbol) (not (keywordp symbol))) (get symbol 'variable-documentation))) ,#'describe-variable) - ("face" ,#'facep ,(lambda (s _b _f) (describe-face s))))) + ("face" ,#'facep ,(lambda (s _b _f) (describe-face s)))) + "List of providers of information about symbols. +Each element has the form (NAME TESTFUN DESCFUN) where: + NAME is a string naming a category of object, such as \"type\" or \"face\". + TESTFUN is a predicate which takes a symbol and returns non-nil if the + symbol is such an object. + DESCFUN is a function which takes three arguments (a symbol, a buffer, + and a frame), inserts the description of that symbol in the current buffer + and returns that text as well.") ;;;###autoload (defun help-make-xrefs (&optional buffer) commit 2df391c202eeee0d575980555443a5e81b8f6b1f Author: Philipp Stephani Date: Mon Jan 22 23:56:21 2018 +0100 Add a regression test for Bug#30004. * test/src/callint-tests.el (call-interactively/incomplete-multibyte-sequence): New unit test. diff --git a/test/src/callint-tests.el b/test/src/callint-tests.el new file mode 100644 index 0000000000..8fc7edf010 --- /dev/null +++ b/test/src/callint-tests.el @@ -0,0 +1,38 @@ +;;; callint-tests.el --- unit tests for callint.c -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Free Software Foundation, Inc. + +;; Author: Philipp Stephani + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; Unit tests for src/callint.c. + +;;; Code: + +(require 'ert) + +(ert-deftest call-interactively/incomplete-multibyte-sequence () + "Check that Bug#30004 is fixed." + (let ((data (should-error (call-interactively (lambda () (interactive "\xFF")))))) + (should + (equal + (cdr data) + '("Invalid control letter `\u00FF' (#o377, #x00ff) in interactive calling string"))))) + +;;; callint-tests.el ends here commit 3558d96b60393893a346f4382b813ca0738f9d9b Author: Philipp Stephani Date: Mon Jan 22 23:27:21 2018 +0100 * src/nsterm.m (x_set_offset): Remove unused variable 'screens'. diff --git a/src/nsterm.m b/src/nsterm.m index d2927d26b4..4b81ad2a6c 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1735,7 +1735,6 @@ -(void)remove -------------------------------------------------------------------------- */ { NSView *view = FRAME_NS_VIEW (f); - NSArray *screens = [NSScreen screens]; NSScreen *screen = [[view window] screen]; NSTRACE ("x_set_offset"); commit 71e458505f3f3fb5e545b83f7609dac5dff1c289 Author: Juri Linkov Date: Tue Jan 23 00:14:10 2018 +0200 Restore isearch correctly after M-e in special modes (bug#30187) * lisp/isearch.el (isearch-suspended): New defvar. (with-isearch-suspended): Set isearch-suspended to t at the beginning, then set it back to nil at the end. * lisp/comint.el (comint-history-isearch-backward) (comint-history-isearch-backward-regexp): Set global value of comint-history-isearch to t. (comint-history-isearch-end): Reevaluate comint-history-isearch when isearch-edit-string finishes. * lisp/dired-aux.el (dired-isearch-filenames) (dired-isearch-filenames-regexp): Set global value of dired-isearch-filenames to t. (dired-isearch-filenames-end): Reevaluate dired-isearch-filenames when isearch-edit-string finishes. diff --git a/lisp/comint.el b/lisp/comint.el index a79e34b36c..8dba317099 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1434,14 +1434,14 @@ If nil, Isearch operates on the whole comint buffer." (defun comint-history-isearch-backward () "Search for a string backward in input history using Isearch." (interactive) - (let ((comint-history-isearch t)) - (isearch-backward nil t))) + (setq comint-history-isearch t) + (isearch-backward nil t)) (defun comint-history-isearch-backward-regexp () "Search for a regular expression backward in input history using Isearch." (interactive) - (let ((comint-history-isearch t)) - (isearch-backward-regexp nil t))) + (setq comint-history-isearch t) + (isearch-backward-regexp nil t)) (defvar-local comint-history-isearch-message-overlay nil) @@ -1472,7 +1472,9 @@ Intended to be added to `isearch-mode-hook' in `comint-mode'." (setq isearch-message-function nil) (setq isearch-wrap-function nil) (setq isearch-push-state-function nil) - (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t)) + (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t) + (unless isearch-suspended + (custom-reevaluate-setting 'comint-history-isearch))) (defun comint-goto-input (pos) "Put input history item of the absolute history position POS." diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 223b254c4b..55b68a372e 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2766,7 +2766,9 @@ Intended to be added to `isearch-mode-hook'." "Clean up the Dired file name search after terminating isearch." (define-key isearch-mode-map "\M-sff" nil) (dired-isearch-filenames-mode -1) - (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t)) + (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t) + (unless isearch-suspended + (custom-reevaluate-setting 'dired-isearch-filenames))) (defun dired-isearch-filter-filenames (beg end) "Test whether some part of the current search match is inside a file name. @@ -2779,15 +2781,15 @@ is part of a file name (i.e., has the text property `dired-filename')." (defun dired-isearch-filenames () "Search for a string using Isearch only in file names in the Dired buffer." (interactive) - (let ((dired-isearch-filenames t)) - (isearch-forward nil t))) + (setq dired-isearch-filenames t) + (isearch-forward nil t)) ;;;###autoload (defun dired-isearch-filenames-regexp () "Search for a regexp using Isearch only in file names in the Dired buffer." (interactive) - (let ((dired-isearch-filenames t)) - (isearch-forward-regexp nil t))) + (setq dired-isearch-filenames t) + (isearch-forward-regexp nil t)) ;; Functions for searching in tags style among marked files. diff --git a/lisp/isearch.el b/lisp/isearch.el index 3725779703..23dd9afccd 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1233,6 +1233,8 @@ If this is set inside code wrapped by the macro (define-obsolete-variable-alias 'isearch-new-word 'isearch-new-regexp-function "25.1") +(defvar isearch-suspended nil) + (defmacro with-isearch-suspended (&rest body) "Exit Isearch mode, run BODY, and reinvoke the pending search. You can update the global isearch variables by setting new values to @@ -1299,6 +1301,8 @@ You can update the global isearch variables by setting new values to isearch-original-minibuffer-message-timeout) old-point old-other-end) + (setq isearch-suspended t) + ;; Actually terminate isearching until editing is done. ;; This is so that the user can do anything without failure, ;; like switch buffers and start another isearch, and return. @@ -1313,6 +1317,8 @@ You can update the global isearch variables by setting new values to (unwind-protect (progn ,@body) + (setq isearch-suspended nil) + ;; Always resume isearching by restarting it. (isearch-mode isearch-forward isearch-regexp @@ -1374,6 +1380,7 @@ You can update the global isearch variables by setting new values to (message ""))))) (quit ; handle abort-recursive-edit + (setq isearch-suspended nil) (isearch-abort) ;; outside of let to restore outside global values ))) commit 4aabb425dba14c752befa15f609cc4864be41ef6 Author: Paul Eggert Date: Mon Jan 22 08:49:43 2018 -0800 ; Spelling fix diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index 1788f0d71f..2e53382fa8 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el @@ -78,7 +78,7 @@ See the documentation for `list-load-path-shadows' for further information." shadows ; List of shadowings, to be returned. files ; File names ever seen, with dirs. dir ; The dir being currently scanned. - dir-case-insensitive ; `file-name-case-insentive-p' for dir. + dir-case-insensitive ; `file-name-case-insensitive-p' of dir. curr-files ; This dir's Emacs Lisp files. orig-dir ; Where the file was first seen. files-seen-this-dir ; Files seen so far in this dir. commit 35675bb93f4620c43ca766e8a2d8708fd323c684 Merge: c42959cc20 1fc98ed073 Author: Paul Eggert Date: Mon Jan 22 08:43:54 2018 -0800 Merge from origin/emacs-26 1fc98ed073 ; Spelling fix bb396a369c Update Org to v9.1.6 fa582153f7 Use text-pixels values only when saving framesets (Bug#30141) 6b01b9475d Minor improvement in section "Pages" of the usere manual e8c8bd3de2 Minor improvements in user manual 26b8b92e63 Improve the "Mark" chapter of the user manual 759569fe40 Improve the "Buffers" chapter of the user manual c2e6d121ff * lisp/term.el (term-send-input): Fix text duplication in ... 854a1c0a61 Improve "Buffers" in the user manual # Conflicts: # etc/NEWS commit 1fc98ed073a2d26ad941748ecb13aa6f47dd7b01 (refs/remotes/origin/emacs-26) Author: Paul Eggert Date: Mon Jan 22 08:41:49 2018 -0800 ; Spelling fix diff --git a/test/lisp/emacs-lisp/shadow-tests.el b/test/lisp/emacs-lisp/shadow-tests.el index 9d4969fe8b..f0aa1310bc 100644 --- a/test/lisp/emacs-lisp/shadow-tests.el +++ b/test/lisp/emacs-lisp/shadow-tests.el @@ -33,7 +33,7 @@ (ert-deftest shadow-case-insensitive () "Test shadowing for case insensitive filenames." - ;; Override `file-name-case-insentive-p' so we test the same thing + ;; Override `file-name-case-insensitive-p' so we test the same thing ;; regardless of what file system we're running on. (cl-letf (((symbol-function 'file-name-case-insensitive-p) (lambda (_f) t))) (should (equal (list (expand-file-name "p1/foo" shadow-tests-data-directory) commit bb396a369c93e57b033844003c7ceab61d61aa08 Author: Rasmus Date: Mon Jan 22 15:57:42 2018 +0100 Update Org to v9.1.6 Please note this is a bugfix release. See etc/ORG-NEWS for details. diff --git a/doc/misc/org.texi b/doc/misc/org.texi index a252db4818..37a9648bfb 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -4,8 +4,8 @@ @settitle The Org Manual @include docstyle.texi -@set VERSION 9.1.4 -@set DATE 2017-09-17 +@set VERSION 9.1.6 +@set DATE 2018-01-03 @c Version and Contact Info @set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page} diff --git a/etc/NEWS b/etc/NEWS index b4c489cf7b..46762d65e1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -635,7 +635,7 @@ state to take effect (making a frame visible, for example). * Changes in Specialized Modes and Packages in Emacs 26.1 --- -** Emacs 26.1 comes with Org v9.1.4. +** Emacs 26.1 comes with Org v9.1.6. See the file ORG-NEWS for user-visible changes in Org. --- diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 0b9c9767d9..1affe54852 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,6 +1,6 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.1.4} -\def\versionyear{2017} % latest update +\def\orgversionnumber{9.1.6} +\def\versionyear{2018} % latest update \input emacsver.tex %**start of header diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 8a17ee4f1f..5f378b2173 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -74,7 +74,6 @@ (declare-function org-mark-ring-push "org" (&optional pos buffer)) (declare-function org-narrow-to-subtree "org" ()) (declare-function org-next-block "org" (arg &optional backward block-regexp)) -(declare-function org-number-sequence "org-compat" (from &optional to inc)) (declare-function org-open-at-point "org" (&optional in-emacs reference-buffer)) (declare-function org-outline-overlay-data "org" (&optional use-markers)) (declare-function org-previous-block "org" (arg &optional block-regexp)) @@ -82,7 +81,7 @@ (declare-function org-reverse-string "org" (string)) (declare-function org-set-outline-overlay-data "org" (data)) (declare-function org-show-context "org" (&optional key)) -(declare-function org-src-coderef-format "org-src" (element)) +(declare-function org-src-coderef-format "org-src" (&optional element)) (declare-function org-src-coderef-regexp "org-src" (fmt &optional label)) (declare-function org-table-align "org-table" ()) (declare-function org-table-end "org-table" (&optional table-type)) @@ -2476,7 +2475,7 @@ in the buffer." (point)))))) (defun org-babel-result-to-file (result &optional description) - "Convert RESULT into an `org-mode' link with optional DESCRIPTION. + "Convert RESULT into an Org link with optional DESCRIPTION. If the `default-directory' is different from the containing file's directory then expand relative links." (when (stringp result) @@ -2761,22 +2760,27 @@ block but are passed literally to the \"example-block\"." (if org-babel-use-quick-and-dirty-noweb-expansion (while (re-search-forward rx nil t) (let* ((i (org-babel-get-src-block-info 'light)) - (body (org-babel-expand-noweb-references i)) + (body (if (org-babel-noweb-p (nth 2 i) :eval) + (org-babel-expand-noweb-references i) + (nth 1 i))) (sep (or (cdr (assq :noweb-sep (nth 2 i))) "\n")) (full (if comment (let ((cs (org-babel-tangle-comment-links i))) - (concat (funcall c-wrap (car cs)) "\n" - body "\n" - (funcall c-wrap (cadr cs)))) + (concat (funcall c-wrap (car cs)) "\n" + body "\n" + (funcall c-wrap (cadr cs)))) body))) (setq expansion (cons sep (cons full expansion))))) (org-babel-map-src-blocks nil - (let ((i (org-babel-get-src-block-info 'light))) + (let ((i (let ((org-babel-current-src-block-location (point))) + (org-babel-get-src-block-info 'light)))) (when (equal (or (cdr (assq :noweb-ref (nth 2 i))) (nth 4 i)) source-name) - (let* ((body (org-babel-expand-noweb-references i)) + (let* ((body (if (org-babel-noweb-p (nth 2 i) :eval) + (org-babel-expand-noweb-references i) + (nth 1 i))) (sep (or (cdr (assq :noweb-sep (nth 2 i))) "\n")) (full (if comment diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el index c474b1e2be..d2c32fac81 100644 --- a/lisp/org/ob-exp.el +++ b/lisp/org/ob-exp.el @@ -58,9 +58,13 @@ returned is the value of the last form in BODY. Assume that point is at the beginning of the Babel block." (declare (indent 1) (debug body)) `(let ((source (get-text-property (point) 'org-reference))) - (with-current-buffer org-babel-exp-reference-buffer + ;; Source blocks created during export process (e.g., by other + ;; source blocks) are not referenced. In this case, do not move + ;; point at all. + (with-current-buffer (if source org-babel-exp-reference-buffer + (current-buffer)) (org-with-wide-buffer - (goto-char source) + (when source (goto-char source)) ,@body)))) (defun org-babel-exp-src-block () diff --git a/lisp/org/ob-gnuplot.el b/lisp/org/ob-gnuplot.el index 1acce50247..674627b8fa 100644 --- a/lisp/org/ob-gnuplot.el +++ b/lisp/org/ob-gnuplot.el @@ -116,6 +116,8 @@ code." (timefmt (cdr (assq :timefmt params))) (time-ind (or (cdr (assq :timeind params)) (when timefmt 1))) + (directory (and (buffer-file-name) + (file-name-directory (buffer-file-name)))) (add-to-body (lambda (text) (setq body (concat text "\n" body))))) ;; append header argument settings to body (when title (funcall add-to-body (format "set title '%s'" title))) @@ -161,7 +163,10 @@ code." (format "\\$%s" (car pair)) (cdr pair) body))) vars) (when prologue (funcall add-to-body prologue)) - (when epilogue (setq body (concat body "\n" epilogue)))) + (when epilogue (setq body (concat body "\n" epilogue))) + ;; Setting the directory needs to be done first so that + ;; subsequent 'output' directive goes to the right place. + (when directory (funcall add-to-body (format "cd '%s'" directory)))) body)) (defun org-babel-execute:gnuplot (body params) diff --git a/lisp/org/ob-haskell.el b/lisp/org/ob-haskell.el index 301c6837b3..b19ee6d70f 100644 --- a/lisp/org/ob-haskell.el +++ b/lisp/org/ob-haskell.el @@ -59,14 +59,23 @@ (defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"") +(defvar haskell-prompt-regexp) + (defun org-babel-execute:haskell (body params) "Execute a block of Haskell code." + (require 'inf-haskell) + (add-hook 'inferior-haskell-hook + (lambda () + (setq-local comint-prompt-regexp + (concat haskell-prompt-regexp "\\|^λ?> ")))) (let* ((session (cdr (assq :session params))) (result-type (cdr (assq :result-type params))) (full-body (org-babel-expand-body:generic body params (org-babel-variable-assignments:haskell params))) (session (org-babel-haskell-initiate-session session params)) + (comint-preoutput-filter-functions + (cons 'ansi-color-filter-apply comint-preoutput-filter-functions)) (raw (org-babel-comint-with-output (session org-babel-haskell-eoe t full-body) (insert (org-trim full-body)) diff --git a/lisp/org/ob-picolisp.el b/lisp/org/ob-picolisp.el index 0d44c9832d..b6dc8986f9 100644 --- a/lisp/org/ob-picolisp.el +++ b/lisp/org/ob-picolisp.el @@ -39,9 +39,9 @@ ;; directory). ;; Although it might seem more natural to use Emacs Lisp for most -;; Lisp-based programming tasks inside Org-Mode, an Emacs library -;; written in Emacs Lisp, PicoLisp has at least two outstanding -;; features that make it a valuable addition to Org-Babel: +;; Lisp-based programming tasks inside Org, an Emacs library written +;; in Emacs Lisp, PicoLisp has at least two outstanding features that +;; make it a valuable addition to Org Babel: ;; PicoLisp _is_ an object-oriented database with a Prolog-based query ;; language implemented in PicoLisp (Pilog). Database objects are diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el index 3ea050fffe..951e4d2a4b 100644 --- a/lisp/org/ob-python.el +++ b/lisp/org/ob-python.el @@ -239,6 +239,15 @@ def main(): open('%s', 'w').write( pprint.pformat(main()) )") +(defconst org-babel-python--exec-tmpfile + (concat + "__org_babel_python_fname = '%s'; " + "__org_babel_python_fh = open(__org_babel_python_fname); " + "exec(compile(" + "__org_babel_python_fh.read(), __org_babel_python_fname, 'exec'" + ")); " + "__org_babel_python_fh.close()")) + (defun org-babel-python-evaluate (session body &optional result-type result-params preamble) "Evaluate BODY as Python code." @@ -306,16 +315,23 @@ last statement in BODY, as elisp." (results (pcase result-type (`output - (mapconcat - #'org-trim - (butlast - (org-babel-comint-with-output - (session org-babel-python-eoe-indicator t body) - (funcall input-body body) - (funcall send-wait) (funcall send-wait) - (insert org-babel-python-eoe-indicator) - (funcall send-wait)) - 2) "\n")) + (let ((body (if (string-match-p ".\n+." body) ; Multiline + (let ((tmp-src-file (org-babel-temp-file + "python-"))) + (with-temp-file tmp-src-file (insert body)) + (format org-babel-python--exec-tmpfile + tmp-src-file)) + body))) + (mapconcat + #'org-trim + (butlast + (org-babel-comint-with-output + (session org-babel-python-eoe-indicator t body) + (funcall input-body body) + (funcall send-wait) (funcall send-wait) + (insert org-babel-python-eoe-indicator) + (funcall send-wait)) + 2) "\n"))) (`value (let ((tmp-file (org-babel-temp-file "python-"))) (org-babel-comint-with-output diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el index de30a76129..872f7f9815 100644 --- a/lisp/org/ob-ref.el +++ b/lisp/org/ob-ref.el @@ -65,24 +65,21 @@ (declare-function org-show-context "org" (&optional key)) (declare-function org-trim "org" (s &optional keep-lead)) -(defvar org-babel-ref-split-regexp - "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*") - (defvar org-babel-update-intermediate nil "Update the in-buffer results of code blocks executed to resolve references.") (defun org-babel-ref-parse (assignment) "Parse a variable ASSIGNMENT in a header argument. + If the right hand side of the assignment has a literal value -return that value, otherwise interpret as a reference to an -external resource and find its value using -`org-babel-ref-resolve'. Return a list with two elements. The -first element of the list will be the name of the variable, and -the second will be an emacs-lisp representation of the value of -the variable." - (when (string-match org-babel-ref-split-regexp assignment) - (let ((var (match-string 1 assignment)) - (ref (match-string 2 assignment))) +return that value, otherwise interpret it as a reference to an +external resource and find its value using `org-babel-ref-resolve'. + +Return a list with two elements: the name of the variable, and an +Emacs Lisp representation of the value of the variable." + (when (string-match "\\(.+?\\)=" assignment) + (let ((var (org-trim (match-string 1 assignment))) + (ref (org-trim (substring assignment (match-end 0))))) (cons (intern var) (let ((out (save-excursion (when org-babel-current-src-block-location diff --git a/lisp/org/ob-scheme.el b/lisp/org/ob-scheme.el index 029569edac..cc78b574d0 100644 --- a/lisp/org/ob-scheme.el +++ b/lisp/org/ob-scheme.el @@ -40,6 +40,7 @@ ;;; Code: (require 'ob) (require 'geiser nil t) +(require 'geiser-impl nil t) (defvar geiser-repl--repl) ; Defined in geiser-repl.el (defvar geiser-impl--implementation) ; Defined in geiser-impl.el (defvar geiser-default-implementation) ; Defined in geiser-impl.el diff --git a/lisp/org/ob-stan.el b/lisp/org/ob-stan.el index 38cda4cdbc..6fa9fe5c94 100644 --- a/lisp/org/ob-stan.el +++ b/lisp/org/ob-stan.el @@ -49,11 +49,12 @@ (defcustom org-babel-stan-cmdstan-directory nil "CmdStan source directory. -'make' will be called from this directory to compile the Stan -block. When nil, executing Stan blocks dumps the content to a -plain text file." +Call \"make\" from this directory to compile the Stan block. +When nil, executing Stan blocks dumps the content to a file." :group 'org-babel - :type 'string) + :type '(choice + (directory :tag "Compilation directory") + (const :tag "Dump to a file" nil))) (defvar org-babel-default-header-args:stan '((:results . "file"))) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 9f8d294044..9aaec33070 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -395,35 +395,35 @@ the daily/weekly agenda, see `org-agenda-skip-function'.") (choice :tag "Condition type" (list :tag "Regexp matches" :inline t - (const :format "" 'regexp) + (const :format "" regexp) (regexp)) (list :tag "Regexp does not match" :inline t - (const :format "" 'notregexp) + (const :format "" notregexp) (regexp)) (list :tag "TODO state is" :inline t - (const 'todo) + (const todo) (choice - (const :tag "Any not-done state" 'todo) - (const :tag "Any done state" 'done) - (const :tag "Any state" 'any) + (const :tag "Any not-done state" todo) + (const :tag "Any done state" done) + (const :tag "Any state" any) (list :tag "Keyword list" (const :format "" quote) (repeat (string :tag "Keyword"))))) (list :tag "TODO state is not" :inline t - (const 'nottodo) + (const nottodo) (choice - (const :tag "Any not-done state" 'todo) - (const :tag "Any done state" 'done) - (const :tag "Any state" 'any) + (const :tag "Any not-done state" todo) + (const :tag "Any done state" done) + (const :tag "Any state" any) (list :tag "Keyword list" (const :format "" quote) (repeat (string :tag "Keyword"))))) - (const :tag "scheduled" 'scheduled) - (const :tag "not scheduled" 'notscheduled) - (const :tag "deadline" 'deadline) - (const :tag "no deadline" 'notdeadline) - (const :tag "timestamp" 'timestamp) - (const :tag "no timestamp" 'nottimestamp)))))) + (const :tag "scheduled" scheduled) + (const :tag "not scheduled" notscheduled) + (const :tag "deadline" deadline) + (const :tag "no deadline" notdeadline) + (const :tag "timestamp" timestamp) + (const :tag "no timestamp" nottimestamp)))))) (list :tag "Non-standard skipping condition" :value (org-agenda-skip-function) (const org-agenda-skip-function) @@ -3563,7 +3563,7 @@ removed from the entry content. Currently only `planning' is allowed here." txt)) (defun org-check-for-org-mode () - "Make sure current buffer is in org-mode. Error if not." + "Make sure current buffer is in Org mode. Error if not." (or (derived-mode-p 'org-mode) (error "Cannot execute Org agenda command on buffer in %s" major-mode))) @@ -4509,7 +4509,7 @@ is active." (with-current-buffer buffer (with-syntax-table (org-search-syntax-table) (unless (derived-mode-p 'org-mode) - (error "Agenda file %s is not in `org-mode'" file)) + (error "Agenda file %s is not in Org mode" file)) (let ((case-fold-search t)) (save-excursion (save-restriction @@ -4774,7 +4774,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries." rtnall (append rtnall rtn)) (with-current-buffer buffer (unless (derived-mode-p 'org-mode) - (error "Agenda file %s is not in `org-mode'" file)) + (error "Agenda file %s is not in Org mode" file)) (save-excursion (save-restriction (if (eq buffer org-agenda-restrict) @@ -5067,9 +5067,9 @@ of what a project is and how to check if it stuck, customize the variable (defun org-agenda-cleanup-fancy-diary () "Remove unwanted stuff in buffer created by `fancy-diary-display'. -This gets rid of the date, the underline under the date, and -the dummy entry installed by `org-mode' to ensure non-empty diary for each -date. It also removes lines that contain only whitespace." +This gets rid of the date, the underline under the date, and the +dummy entry installed by Org mode to ensure non-empty diary for +each date. It also removes lines that contain only whitespace." (goto-char (point-min)) (if (looking-at ".*?:[ \t]*") (progn @@ -5214,7 +5214,7 @@ the documentation of `org-diary'." (list (format "ORG-AGENDA-ERROR: No such org-file %s" file)) (with-current-buffer buffer (unless (derived-mode-p 'org-mode) - (error "Agenda file %s is not in `org-mode'" file)) + (error "Agenda file %s is not in Org mode" file)) (setq org-agenda-buffer (or org-agenda-buffer buffer)) (setf org-agenda-current-date date) (save-excursion diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el index a78113493b..755de7fdac 100644 --- a/lisp/org/org-archive.el +++ b/lisp/org/org-archive.el @@ -429,7 +429,7 @@ Archiving time is retained in the ARCHIVE_TIME node property." (looking-at org-outline-regexp) (setq leader (match-string 0) level (funcall outline-level)) - (setq pos (point)) + (setq pos (point-marker)) (condition-case nil (outline-up-heading 1 t) (error (setq e (point-max)) (goto-char (point-min)))) diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index 24fc0a61f0..cb1741f2f9 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el @@ -927,18 +927,24 @@ Store them in the capture property list." (_ (error "Cannot find target ID \"%s\"" id)))) (`(file+headline ,path ,headline) (set-buffer (org-capture-target-buffer path)) + ;; Org expects the target file to be in Org mode, otherwise + ;; it throws an error. However, the default notes files + ;; should work out of the box. In this case, we switch it to + ;; Org mode. (unless (derived-mode-p 'org-mode) - (error "Target buffer \"%s\" for file+headline not in Org mode" - (current-buffer))) + (org-display-warning + (format "Capture requirement: switching buffer %S to Org mode" + (current-buffer))) + (org-mode)) (org-capture-put-target-region-and-position) (widen) (goto-char (point-min)) (if (re-search-forward (format org-complex-heading-regexp-format (regexp-quote headline)) nil t) - (goto-char (line-beginning-position)) + (beginning-of-line) (goto-char (point-max)) - (or (bolp) (insert "\n")) + (unless (bolp) (insert "\n")) (insert "* " headline "\n") (beginning-of-line 0))) (`(file+olp ,path . ,outline-path) diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index fd076de34e..9bc1f0c06d 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -1456,8 +1456,7 @@ The time is always returned as UTC." (day (nth 3 dt))) (if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day))) (setf (nth 2 dt) org-extend-today-until) - (setq dt (append (list 0 0) (nthcdr 2 dt) '(t))) - (apply #'encode-time dt))) + (apply #'encode-time (append (list 0 0) (nthcdr 2 dt))))) ((or (equal cmt "all") (and (or (not cmt) (equal cmt "auto")) (not lr))) diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 138e14e30b..f32fcd1783 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -32,12 +32,12 @@ (require 'cl-lib) (require 'org-macs) -(declare-function org-at-table.el-p "org" (&optional table-type)) +(declare-function org-at-table.el-p "org" ()) (declare-function org-element-at-point "org-element" ()) (declare-function org-element-type "org-element" (element)) (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) (declare-function org-link-set-parameters "org" (type &rest rest)) -(declare-function org-table-end (&optional table-type)) +(declare-function org-table-end "org-table" (&optional table-type)) (declare-function outline-next-heading "outline" ()) (declare-function table--at-cell-p "table" (position &optional object at-column)) diff --git a/lisp/org/org-duration.el b/lisp/org/org-duration.el index 356a0343ea..1c962ba94e 100644 --- a/lisp/org/org-duration.el +++ b/lisp/org/org-duration.el @@ -51,7 +51,7 @@ (require 'cl-lib) (require 'org-macs) -(declare-function org-trim "org-trim" (s &optional keep-lead)) +(declare-function org-trim "org" (s &optional keep-lead)) ;;; Public variables @@ -99,8 +99,8 @@ sure to call the following command: :set (lambda (var val) (set-default var val) (org-duration-set-regexps)) :initialize 'custom-initialize-changed :type '(choice - (const :tag "H:MM" 'h:mm) - (const :tag "H:MM:SS" 'h:mm:ss) + (const :tag "H:MM" h:mm) + (const :tag "H:MM:SS" h:mm:ss) (alist :key-type (string :tag "Unit") :value-type (number :tag "Modifier")))) diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el index f9d8055648..4d3f154c25 100644 --- a/lisp/org/org-footnote.el +++ b/lisp/org/org-footnote.el @@ -45,7 +45,7 @@ (declare-function org-element-property "org-element" (property element)) (declare-function org-element-type "org-element" (element)) (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) -(declare-function org-fill-paragraph "org" (&optional justify)) +(declare-function org-fill-paragraph "org" (&optional justify region)) (declare-function org-in-block-p "org" (names)) (declare-function org-in-regexp "org" (re &optional nlines visually)) (declare-function org-in-verbatim-emphasis "org" ()) diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el index 5b65fab593..1825b88cdf 100644 --- a/lisp/org/org-inlinetask.el +++ b/lisp/org/org-inlinetask.el @@ -182,24 +182,28 @@ The number of levels is controlled by `org-inlinetask-min-level'." (defun org-inlinetask-goto-end () "Go to the end of the inline task at point. -Return point." + Return point." (save-match-data (beginning-of-line) (let* ((case-fold-search t) - (inlinetask-re (org-inlinetask-outline-regexp)) - (task-end-re (concat inlinetask-re "END[ \t]*$"))) + (inlinetask-re (org-inlinetask-outline-regexp)) + (task-end-re (concat inlinetask-re "END[ \t]*$"))) (cond - ((looking-at task-end-re)) - ((looking-at inlinetask-re) - (forward-line) - (cond - ((looking-at task-end-re)) - ((looking-at inlinetask-re)) - ((org-inlinetask-in-task-p) - (re-search-forward inlinetask-re nil t)))) - (t (re-search-forward inlinetask-re nil t))) - (end-of-line) - (point)))) + ((looking-at-p task-end-re) + (forward-line)) + ((looking-at-p inlinetask-re) + (forward-line) + (cond + ((looking-at-p task-end-re) (forward-line)) + ((looking-at-p inlinetask-re)) + ((org-inlinetask-in-task-p) + (re-search-forward inlinetask-re nil t) + (forward-line)) + (t nil))) + (t + (re-search-forward inlinetask-re nil t) + (forward-line))))) + (point)) (defun org-inlinetask-get-task-level () "Get the level of the inline task around. @@ -330,7 +334,9 @@ This function is meant to be used in `org-cycle-hook'." (org-inlinetask-goto-end))))) (`children (save-excursion - (while (and (outline-next-heading) (org-inlinetask-at-task-p)) + (while + (or (org-inlinetask-at-task-p) + (and (outline-next-heading) (org-inlinetask-at-task-p))) (org-inlinetask-toggle-visibility) (org-inlinetask-goto-end)))))) diff --git a/lisp/org/org-pcomplete.el b/lisp/org/org-pcomplete.el index f0c0793827..a7cc09def4 100644 --- a/lisp/org/org-pcomplete.el +++ b/lisp/org/org-pcomplete.el @@ -41,11 +41,6 @@ ;;;; Customization variables -(defgroup org-complete nil - "Outline-based notes management and organizer." - :tag "Org" - :group 'org) - (defvar org-drawer-regexp) (defvar org-property-re) (defvar org-current-tag-alist) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 0ba7165abe..3932671e8b 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -644,17 +644,30 @@ nil When nil, the command tries to be smart and figure out the (org-table-align)))) ;;;###autoload -(defun org-table-import (file arg) +(defun org-table-import (file separator) "Import FILE as a table. -The file is assumed to be tab-separated. Such files can be produced by most -spreadsheet and database applications. If no tabs (at least one per line) -are found, lines will be split on whitespace into fields." + +The command tries to be smart and figure out the separator in the +following way: + + - when each line contains a TAB, assume TAB-separated material + - when each line contains a comma, assume CSV material + - else, assume one or more SPACE characters as separator. + +When non-nil, SEPARATOR specifies the field separator in the +lines. It can have the following values: + +(4) Use the comma as a field separator +(16) Use a TAB as field separator +(64) Prompt for a regular expression as field separator +integer When a number, use that many spaces, or a TAB, as field separator +regexp When a regular expression, use it to match the separator." (interactive "f\nP") - (or (bolp) (newline)) + (unless (bolp) (insert "\n")) (let ((beg (point)) (pm (point-max))) (insert-file-contents file) - (org-table-convert-region beg (+ (point) (- (point-max) pm)) arg))) + (org-table-convert-region beg (+ (point) (- (point-max) pm)) separator))) ;;;###autoload @@ -1166,7 +1179,7 @@ to a number. In the case of a timestamp, increment by days." (- (org-time-string-to-absolute txt) (org-time-string-to-absolute txt-up))) ((string-match org-ts-regexp3 txt) 1) - ((string-match "\\([-+]\\)?[0-9]+\\(?:\.[0-9]+\\)?" txt-up) + ((string-match "\\([-+]\\)?\\(?:[0-9]+\\)?\\(?:\.[0-9]+\\)?" txt-up) (- (string-to-number txt) (string-to-number (match-string 0 txt-up)))) (t 1))) @@ -4311,14 +4324,14 @@ FACE, when non-nil, for the highlight." ;;;###autoload (define-minor-mode orgtbl-mode - "The `org-mode' table editor as a minor mode for use in other modes." + "The Org mode table editor as a minor mode for use in other modes." :lighter " OrgTbl" :keymap orgtbl-mode-map (org-load-modules-maybe) (cond ((derived-mode-p 'org-mode) - ;; Exit without error, in case some hook functions calls this - ;; by accident in org-mode. - (message "Orgtbl-mode is not useful in org-mode, command ignored")) + ;; Exit without error, in case some hook functions calls this by + ;; accident in Org mode. + (message "Orgtbl mode is not useful in Org mode, command ignored")) (orgtbl-mode (and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?! ;; Make sure we are first in minor-mode-map-alist diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 749cbe063e..8ec120e9b2 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.1.4")) + (let ((org-release "9.1.6")) org-release)) ;;;###autoload (defun org-git-version () - "The Git version of org-mode. + "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.1.4-44-gfe7310")) + (let ((org-git-version "release_9.1.6-50-g96b33f")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org-w3m.el b/lisp/org/org-w3m.el index a3ca478695..706619c5d2 100644 --- a/lisp/org/org-w3m.el +++ b/lisp/org/org-w3m.el @@ -57,7 +57,7 @@ :description (or w3m-current-title w3m-current-url)))) (defun org-w3m-copy-for-org-mode () - "Copy current buffer content or active region with `org-mode' style links. + "Copy current buffer content or active region with Org style links. This will encode `link-title' and `link-location' with `org-make-link-string', and insert the transformed test into the kill ring, so that it can be yanked into an Org buffer with links working correctly." @@ -94,7 +94,7 @@ so that it can be yanked into an Org buffer with links working correctly." ;; get link title at current point. (setq link-title (buffer-substring (point) (org-w3m-get-anchor-end))) - ;; concat `org-mode' style url to `return-content'. + ;; concat Org style url to `return-content'. (setq return-content (concat return-content (org-make-link-string link-location link-title)))) diff --git a/lisp/org/org.el b/lisp/org/org.el index 173003d643..5272061ccc 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -749,7 +749,7 @@ For export specific modules, see also `org-export-backends'." (const :tag "C panel: Simple routines for us with bad memory" org-panel) (const :tag "C registry: A registry for Org links" org-registry) (const :tag "C screen: Visit screen sessions through Org links" org-screen) - (const :tag "C secretary: Team management with org-mode" org-secretary) + (const :tag "C secretary: Team management with Org" org-secretary) (const :tag "C sqlinsert: Convert Org tables to SQL insertions" orgtbl-sqlinsert) (const :tag "C toc: Table of contents for Org buffer" org-toc) (const :tag "C track: Keep up with Org mode development" org-track) @@ -1710,7 +1710,7 @@ doesn't specify any upper case character." :type '(choice (const :tag "Case-sensitive" nil) (const :tag "Case-insensitive" t) - (const :tag "Case-insensitive for lower case searches only" 'smart))) + (const :tag "Case-insensitive for lower case searches only" smart))) (defcustom org-occur-hook '(org-first-headline-recenter) "Hook that is run after `org-occur' has constructed a sparse tree. @@ -4167,7 +4167,10 @@ A string will be inserted as-is in the header of the document." (list :tag "options/package pair" (string :tag "options") (string :tag "package") - (boolean :tag "Snippet")) + (boolean :tag "Snippet") + (choice + (const :tag "For all compilers" nil) + (repeat :tag "Allowed compiler" string))) (string :tag "A line of LaTeX")))) (defcustom org-latex-packages-alist nil @@ -4870,7 +4873,7 @@ After a match, the following groups carry important information: ("beamer" org-startup-with-beamer-mode t) ("entitiespretty" org-pretty-entities t) ("entitiesplain" org-pretty-entities nil)) - "Variable associated with STARTUP options for org-mode. + "Variable associated with STARTUP options for Org. Each element is a list of three items: the startup options (as written in the #+STARTUP line), the corresponding variable, and the value to set this variable to if the option is found. An optional forth element PUSH @@ -5934,7 +5937,7 @@ by a #." (defun org-fontify-meta-lines-and-blocks (limit) (condition-case nil (org-fontify-meta-lines-and-blocks-1 limit) - (error (message "org-mode fontification error in %S at %d" + (error (message "Org mode fontification error in %S at %d" (current-buffer) (line-number-at-pos))))) @@ -6925,6 +6928,7 @@ If POS is nil, use `point' instead." (org-list-set-item-visibility (point-at-bol) struct 'children) (org-show-entry) (org-with-limited-levels (org-show-children)) + (org-show-set-visibility 'canonical) ;; FIXME: This slows down the func way too much. ;; How keep drawers hidden in subtree anyway? ;; (when (memq 'org-cycle-hide-drawers org-cycle-hook) @@ -7019,20 +7023,22 @@ With a numeric prefix, show all headlines up to that level." (save-excursion (org-back-to-heading t) (outline-hide-subtree) - (org-reveal) - (cond - ((equal state "folded") - (outline-hide-subtree)) - ((equal state "children") - (org-show-hidden-entry) - (org-show-children)) - ((equal state "content") - (save-excursion - (save-restriction - (org-narrow-to-subtree) - (org-content)))) - ((member state '("all" "showall")) - (outline-show-subtree))))))) + (org-reveal)) + (cond + ((equal state "folded") + (outline-hide-subtree) + (org-end-of-subtree t t)) + ((equal state "children") + (org-show-hidden-entry) + (org-show-children)) + ((equal state "content") + (save-excursion + (save-restriction + (org-narrow-to-subtree) + (org-content))) + (org-end-of-subtree t t)) + ((member state '("all" "showall")) + (outline-show-subtree)))))) (unless no-cleanup (org-cycle-hide-archived-subtrees 'all) (org-cycle-hide-drawers 'all) @@ -7181,11 +7187,12 @@ are at least `org-cycle-separator-lines' empty lines before the headline." "Return `org-agenda-files' list, plus all open Org files. This is useful for operations that need to scan all of a user's open and agenda-wise Org files." - (let ((files (mapcar 'expand-file-name (org-agenda-files)))) + (let ((files (mapcar #'expand-file-name (org-agenda-files)))) (dolist (buf (buffer-list)) (with-current-buffer buf (when (and (derived-mode-p 'org-mode) (buffer-file-name)) - (cl-pushnew (expand-file-name (buffer-file-name)) files)))) + (cl-pushnew (expand-file-name (buffer-file-name)) files + :test #'equal)))) files)) (defsubst org-entry-beginning-position () @@ -9949,20 +9956,24 @@ according to FMT (default from `org-email-link-description-format')." (reverse slines))) "\n"))))) (mapconcat #'identity (split-string s) " "))) +(defconst org-link-escape-chars + ;;%20 %5B %5D %25 + '(?\s ?\[ ?\] ?%) + "List of characters that should be escaped in a link when stored to Org. +This is the list that is used for internal purposes.") + (defun org-make-link-string (link &optional description) "Make a link with brackets, consisting of LINK and DESCRIPTION." (unless (org-string-nw-p link) (error "Empty link")) (let ((uri (cond ((string-match org-link-types-re link) (concat (match-string 1 link) (org-link-escape (substring link (match-end 1))))) - ;; For readability, url-encode internal links only - ;; when absolutely needed (i.e, when they contain - ;; square brackets). File links however, are - ;; encoded since, e.g., spaces are significant. ((or (file-name-absolute-p link) - (string-match-p "\\`\\.\\.?/\\|[][]" link)) + (string-match-p "\\`\\.\\.?/" link)) (org-link-escape link)) - (t link))) + ;; For readability, do not encode space characters + ;; in fuzzy links. + (t (org-link-escape link (remq ?\s org-link-escape-chars))))) (description (and (org-string-nw-p description) ;; Remove brackets from description, as they are fatal. @@ -9973,12 +9984,6 @@ according to FMT (default from `org-email-link-description-format')." uri (if description (format "[%s]" description) "")))) -(defconst org-link-escape-chars - ;;%20 %5B %5D %25 - '(?\s ?\[ ?\] ?%) - "List of characters that should be escaped in a link when stored to Org. -This is the list that is used for internal purposes.") - (defun org-link-escape (text &optional table merge) "Return percent escaped representation of TEXT. TEXT is a string with the text to escape. @@ -10280,11 +10285,19 @@ Use TAB to complete link prefixes, then RET for type-specific completion support ;; We are linking to this same file, with a search option (setq link search))))) - ;; Check if we can/should use a relative path. If yes, simplify the link + ;; Check if we can/should use a relative path. If yes, simplify + ;; the link. (let ((case-fold-search nil)) (when (string-match "\\`\\(file\\|docview\\):" link) (let* ((type (match-string-no-properties 0 link)) - (path (substring-no-properties link (match-end 0))) + (path-start (match-end 0)) + (search (and (string-match "::\\(.*\\)\\'" link) + (match-string 1 link))) + (path + (if search + (substring-no-properties + link path-start (match-beginning 0)) + (substring-no-properties link (match-end 0)))) (origpath path)) (cond ((or (eq org-link-file-path-type 'absolute) @@ -10305,7 +10318,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (setq path (substring (expand-file-name path) (match-end 0))) (setq path (abbreviate-file-name (expand-file-name path))))))) - (setq link (concat type path)) + (setq link (concat type path (and search (concat "::" search)))) (when (equal desc origpath) (setq desc path))))) @@ -12185,7 +12198,7 @@ There are two templates for each key, the first uses the original Org syntax, the second uses Emacs Muse-like syntax tags. These Muse-like tags become the default when the /org-mtags.el/ module has been loaded. See also the variable `org-mtags-prefer-muse-templates'." - :group 'org-completion + :group 'org-edit-structure :type '(repeat (list (string :tag "Key") @@ -12377,7 +12390,7 @@ When called through ELisp, arg is also interpreted in the following way: (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)")) (looking-at "\\(?: *\\|[ \t]*$\\)")) (let* ((match-data (match-data)) - (startpos (point-at-bol)) + (startpos (copy-marker (line-beginning-position))) (logging (save-match-data (org-entry-get nil "LOGGING" t t))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) diff --git a/lisp/org/ox-beamer.el b/lisp/org/ox-beamer.el index e17087b43c..15b78dcdbc 100644 --- a/lisp/org/ox-beamer.el +++ b/lisp/org/ox-beamer.el @@ -174,11 +174,11 @@ through `org-beamer-environments-extra' variable.") ("quotation" "q" "\\begin{quotation}%a %% %h" "\\end{quotation}") ("quote" "Q" "\\begin{quote}%a %% %h" "\\end{quote}") ("structureenv" "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}") - ("theorem" "t" "\\begin{theorem}%a%U" "\\end{theorem}") - ("definition" "d" "\\begin{definition}%a%U" "\\end{definition}") - ("example" "e" "\\begin{example}%a%U" "\\end{example}") + ("theorem" "t" "\\begin{theorem}%a[%h]" "\\end{theorem}") + ("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}") + ("example" "e" "\\begin{example}%a[%h]" "\\end{example}") ("exampleblock" "E" "\\begin{exampleblock}%a{%h}" "\\end{exampleblock}") - ("proof" "p" "\\begin{proof}%a%U" "\\end{proof}") + ("proof" "p" "\\begin{proof}%a[%h]" "\\end{proof}") ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}")) "Environments triggered by properties in Beamer export. These are the defaults - for user definitions, see diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el index 2dce7bc29b..a656e065b9 100644 --- a/lisp/org/ox-latex.el +++ b/lisp/org/ox-latex.el @@ -2180,19 +2180,16 @@ contextual information." (nth (1- level) '("i" "ii" "iii" "iv")) (1- count))))) (checkbox (cl-case (org-element-property :checkbox item) - (on "$\\boxtimes$ ") - (off "$\\square$ ") - (trans "$\\boxminus$ "))) + (on "$\\boxtimes$") + (off "$\\square$") + (trans "$\\boxminus$"))) (tag (let ((tag (org-element-property :tag item))) - ;; Check-boxes must belong to the tag. - (and tag (format "[{%s}] " - (concat checkbox - (org-export-data tag info))))))) + (and tag (org-export-data tag info))))) (concat counter "\\item" (cond - (tag) - (checkbox (concat " " checkbox)) + ((and checkbox tag) (format "[{%s %s}] " checkbox tag)) + ((or checkbox tag) (format "[{%s}] " (or checkbox tag))) ;; Without a tag or a check-box, if CONTENTS starts with ;; an opening square bracket, add "\relax" to "\item", ;; unless the brackets comes from an initial export diff --git a/lisp/org/ox-md.el b/lisp/org/ox-md.el index a90a29ff02..c4da8fcb14 100644 --- a/lisp/org/ox-md.el +++ b/lisp/org/ox-md.el @@ -500,14 +500,15 @@ TEXT is the string to transcode. INFO is a plist holding contextual information." (when (plist-get info :with-smart-quotes) (setq text (org-export-activate-smart-quotes text :html info))) + ;; The below series of replacements in `text' is order sensitive. + ;; Protect `, *, _, and \ + (setq text (replace-regexp-in-string "[`*_\\]" "\\\\\\&" text)) ;; Protect ambiguous #. This will protect # at the beginning of ;; a line, but not at the beginning of a paragraph. See ;; `org-md-paragraph'. (setq text (replace-regexp-in-string "\n#" "\n\\\\#" text)) ;; Protect ambiguous ! (setq text (replace-regexp-in-string "\\(!\\)\\[" "\\\\!" text nil nil 1)) - ;; Protect `, *, _ and \ - (setq text (replace-regexp-in-string "[`*_\\]" "\\\\\\&" text)) ;; Handle special strings, if required. (when (plist-get info :with-special-strings) (setq text (org-html-convert-special-strings text))) diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el index a7f8e04516..e0c51662d1 100644 --- a/lisp/org/ox-odt.el +++ b/lisp/org/ox-odt.el @@ -721,16 +721,17 @@ nil Ignore math snippets. imagemagick to convert pdf files to png files. `mathjax' Do MathJax preprocessing and arrange for MathJax.js to be loaded. -t Synonym for `mathjax'." + +Any other symbol is a synonym for `mathjax'." :group 'org-export-odt :version "24.4" :package-version '(Org . "8.0") :type '(choice (const :tag "Do not process math in any way" nil) + (const :tag "Leave math verbatim" verbatim) (const :tag "Use dvipng to make images" dvipng) (const :tag "Use imagemagick to make images" imagemagick) - (const :tag "Use MathJax to display math" mathjax) - (const :tag "Leave math verbatim" verbatim))) + (other :tag "Use MathJax to display math" mathjax))) ;;;; Links diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el index 15c9e942b7..5deb7c54e7 100644 --- a/lisp/org/ox-publish.el +++ b/lisp/org/ox-publish.el @@ -57,10 +57,10 @@ Every function in this hook will be called with two arguments: the name of the original file and the name of the file produced.") -(defgroup org-publish nil +(defgroup org-export-publish nil "Options for publishing a set of files." :tag "Org Publishing" - :group 'org) + :group 'org-export) (defcustom org-publish-project-alist nil "Association list to control publishing behavior. diff --git a/lisp/org/ox.el b/lisp/org/ox.el index 1b52f3968f..7bdac4f290 100644 --- a/lisp/org/ox.el +++ b/lisp/org/ox.el @@ -3699,7 +3699,9 @@ the communication channel used for export, as a plist." :translate-alist all-transcoders :exported-data (make-hash-table :test #'eq :size 401))))) ;; `:internal-references' are shared across back-ends. - (prog1 (funcall transcoder data contents new-info) + (prog1 (if (eq type 'plain-text) + (funcall transcoder data new-info) + (funcall transcoder data contents new-info)) (plist-put info :internal-references (plist-get new-info :internal-references))))))) commit c42959cc206bcb52baffd45f892da1b767f0f8c1 Author: Michael Albinus Date: Mon Jan 22 15:07:56 2018 +0100 Fix byte-compiler warning in tramp-sh.el * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Use `set-process-coding-system' rather than interactive `set-buffer-process-coding-system'. * lisp/net/tramp.el (tramp-default-user-alist) (tramp-default-host-alist): Fix docstring. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 09d83dd530..5ee8f93870 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4118,7 +4118,7 @@ process to set up. VEC specifies the connection." (memq 'utf-8-hfs (coding-system-list))) (setq cs-decode 'utf-8-hfs cs-encode 'utf-8-hfs)) - (set-buffer-process-coding-system cs-decode cs-encode) + (set-process-coding-system proc cs-decode cs-encode) (tramp-message vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d1100f0206..d92d63c67b 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -349,7 +349,7 @@ This variable is regarded as obsolete, and will be removed soon." "Default user to use for specific method/host pairs. This is an alist of items (METHOD HOST USER). The first matching item specifies the user to use for a file name which does not specify a -user. METHOD and USER are regular expressions or nil, which is +user. METHOD and HOST are regular expressions or nil, which is interpreted as a regular expression which always matches. If no entry matches, the variable `tramp-default-user' takes effect. @@ -373,7 +373,7 @@ Useful for su and sudo methods mostly." "Default host to use for specific method/user pairs. This is an alist of items (METHOD USER HOST). The first matching item specifies the host to use for a file name which does not specify a -host. METHOD and HOST are regular expressions or nil, which is +host. METHOD and USER are regular expressions or nil, which is interpreted as a regular expression which always matches. If no entry matches, the variable `tramp-default-host' takes effect. commit fa582153f7a75e1eaaef4bfd2b381916233dc0a7 Author: Aaron Jensen Date: Mon Jan 22 10:52:32 2018 +0100 Use text-pixels values only when saving framesets (Bug#30141) * lisp/frameset.el (frameset-persistent-filter-alist): Specify that text-pixels values are by default only saved by framesets so the parameter is not set when restoring (Bug#30141). diff --git a/lisp/frameset.el b/lisp/frameset.el index 3fb6901e94..0e3363d7ae 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -230,11 +230,10 @@ Properties can be set with ;; filtering functions) is copied to FILTERED as is. Keyword values :save, ;; :restore and :never tell the function to copy CURRENT to FILTERED in the ;; respective situations, that is, when saving, restoring, or never at all. -;; Values :save and :restore are not used in this package, because usually if -;; you don't want to save a parameter, you don't want to restore it either. -;; But they can be useful, for example, if you already have a saved frameset -;; created with some intent, and want to reuse it for a different objective -;; where the expected parameter list has different requirements. +;; Values :save and :restore can be useful, for example, if you already +;; have a saved frameset created with some intent, and want to reuse it for +;; a different objective where the expected parameter list has different +;; requirements. ;; ;; Finally, the value can also be a filtering function, or a filtering ;; function plus some arguments. The function is called for each matching @@ -291,6 +290,11 @@ Properties can be set with ;; So, in general, not saving `name' is the right thing to do, though ;; surely there are applications that will want to override this filter. ;; +;; - `frameset--text-pixel-height', `frameset--text-pixel-width': These are used to +;; save the pixel width and height of a frame. They are necessary +;; during restore, but should not be set on the actual frame after +;; restoring, so `:save' is used to ensure they are only saved. +;; ;; - `font', `fullscreen', `height' and `width': These parameters suffer ;; from the fact that they are badly mangled when going through a ;; tty session, though not all in the same way. When saving a GUI frame @@ -442,32 +446,34 @@ DO NOT MODIFY. See `frameset-filter-alist' for a full description.") ;;;###autoload (defvar frameset-persistent-filter-alist (nconc - '((background-color . frameset-filter-sanitize-color) - (buffer-list . :never) - (buffer-predicate . :never) - (buried-buffer-list . :never) + '((background-color . frameset-filter-sanitize-color) + (buffer-list . :never) + (buffer-predicate . :never) + (buried-buffer-list . :never) ;; Don't save the 'client' parameter to avoid that a subsequent ;; `save-buffers-kill-terminal' in a non-client session barks at ;; the user (Bug#29067). - (client . :never) - (delete-before . :never) - (font . frameset-filter-font-param) - (foreground-color . frameset-filter-sanitize-color) - (fullscreen . frameset-filter-shelve-param) - (GUI:font . frameset-filter-unshelve-param) - (GUI:fullscreen . frameset-filter-unshelve-param) - (GUI:height . frameset-filter-unshelve-param) - (GUI:width . frameset-filter-unshelve-param) - (height . frameset-filter-shelve-param) - (outer-window-id . :never) - (parent-frame . :never) - (parent-id . :never) - (mouse-wheel-frame . :never) - (tty . frameset-filter-tty-to-GUI) - (tty-type . frameset-filter-tty-to-GUI) - (width . frameset-filter-shelve-param) - (window-id . :never) - (window-system . :never)) + (client . :never) + (delete-before . :never) + (font . frameset-filter-font-param) + (foreground-color . frameset-filter-sanitize-color) + (frameset--text-pixel-height . :save) + (frameset--text-pixel-width . :save) + (fullscreen . frameset-filter-shelve-param) + (GUI:font . frameset-filter-unshelve-param) + (GUI:fullscreen . frameset-filter-unshelve-param) + (GUI:height . frameset-filter-unshelve-param) + (GUI:width . frameset-filter-unshelve-param) + (height . frameset-filter-shelve-param) + (outer-window-id . :never) + (parent-frame . :never) + (parent-id . :never) + (mouse-wheel-frame . :never) + (tty . frameset-filter-tty-to-GUI) + (tty-type . frameset-filter-tty-to-GUI) + (width . frameset-filter-shelve-param) + (window-id . :never) + (window-system . :never)) frameset-session-filter-alist) "Parameters to filter for persistent framesets. DO NOT MODIFY. See `frameset-filter-alist' for a full description.") commit 6b01b9475d0318f8bb1c7555938f9398b40e5ec7 Author: Eli Zaretskii Date: Sun Jan 21 19:55:46 2018 +0200 Minor improvement in section "Pages" of the usere manual * doc/emacs/text.texi (Pages): Improve wording. Suggested by Will Korteland in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index bb837f94d3..969548d38e 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -381,12 +381,13 @@ at the end). @kbd{C-x C-p C-w} is a handy way to kill a page to move it elsewhere. If you move to another page delimiter with @kbd{C-x [} and @kbd{C-x ]}, then yank the killed page, all the pages will be properly -delimited once again. The reason @kbd{C-x C-p} includes only the -following page delimiter in the region is to ensure that. +delimited once again. Making sure this works as expected is the +reason @kbd{C-x C-p} includes only the following page delimiter in the +region. A numeric argument to @kbd{C-x C-p} specifies which page to go to, -relative to the current one. Zero means the current page, one -the next page, and @minus{}1 the previous one. +relative to the current one. Zero means the current page, one means +the next page, and @minus{}1 means the previous one. @kindex C-x l @findex count-lines-page commit e8c8bd3de2b0c5f8395656ea2dd1e8f5a230f853 Author: Eli Zaretskii Date: Sun Jan 21 19:45:14 2018 +0200 Minor improvements in user manual * doc/emacs/trouble.texi (Emergency Escape, Contributing): Clarify text. Suggested by Jonathan Kyle Mitchell in emacs-manual-bugs@gnu.org diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index dd9d088a56..05114c376c 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -452,7 +452,7 @@ displays, you can use the mouse to kill Emacs or switch to another program. On MS-DOS, you must type @kbd{C-@key{Break}} (twice) to cause -emergency escape---but there are cases where it won't work, when +emergency escape---but there are cases where it won't work, when a system call hangs or when Emacs is stuck in a tight loop in C code. @node Bugs @@ -1225,8 +1225,7 @@ check if existing bug reports are fixed in newer versions of Emacs @url{https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=emacs}. @item -fix existing bug reports -@url{https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=emacs}. +fix existing bug reports. @item @c etc/TODO not in WWW_GNU_ORG commit 26b8b92e63d041e592ec5809cf6fefe308479e5f Author: Eli Zaretskii Date: Sun Jan 21 19:36:57 2018 +0200 Improve the "Mark" chapter of the user manual * doc/emacs/mark.texi (Setting Mark, Marking Objects): Improve and clarify wording. Suggested by John Cummings in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi index c1932b682d..072a3bc4b1 100644 --- a/doc/emacs/mark.texi +++ b/doc/emacs/mark.texi @@ -135,10 +135,11 @@ detailed description of these mouse commands. typing certain cursor motion commands (such as @kbd{S-@key{RIGHT}}, @kbd{S-C-f}, @kbd{S-C-n}, etc.). This is called @dfn{shift-selection}. It sets the mark at point before moving point, but only if there is no -active mark set via shift-selection. The mark set by mouse commands -and by shift-selection behaves slightly differently from the usual -mark: any subsequent unshifted cursor motion command deactivates it -automatically. For details, see @ref{Shift Selection}. +active mark set via a previous shift-selection or mouse commands. The +mark set by mouse commands and by shift-selection behaves slightly +differently from the usual mark: any subsequent unshifted cursor motion +command deactivates it automatically. For details, see @ref{Shift +Selection}. Many commands that insert text, such as @kbd{C-y} (@code{yank}), set the mark at the other end of the inserted text, without activating it. @@ -161,7 +162,7 @@ object such as a word, list, paragraph or page: @table @kbd @item M-@@ -Set mark after end of next word (@code{mark-word}). This does not +Set mark at the end of the next word (@code{mark-word}). This does not move point. @item C-M-@@ Set mark after end of following balanced expression commit 759569fe40ecf7d4dc4e1ec300c9d6f41ea6ac4b Author: Eli Zaretskii Date: Sun Jan 21 19:27:37 2018 +0200 Improve the "Buffers" chapter of the user manual * doc/emacs/buffers.texi (Several Buffers): Correct description of prefix arguments. Clarify "bury". (Buffer Menus): Clarify wording. Reported by John Cummings in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi index 6a8e32bc84..f8c1856058 100644 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi @@ -414,7 +414,8 @@ Perform all flagged deletions and saves (@code{Buffer-menu-execute}). @findex Buffer-menu-unmark @kindex u @r{(Buffer Menu)} Remove all flags from the current line, and move down -(@code{Buffer-menu-unmark}). +(@code{Buffer-menu-unmark}). With a prefix argument, moves up after +removing the flags. @item @key{DEL} @findex Buffer-menu-backup-unmark @@ -438,8 +439,8 @@ Remove all flags from all the lines @end table @noindent -The commands for adding or removing flags, @kbd{d}, @kbd{C-d}, @kbd{s} -and @kbd{u}, all accept a numeric argument as a repeat count. +The commands for removing flags, @kbd{d} and @kbd{C-d}, accept a +numeric argument as a repeat count. The following commands operate immediately on the buffer listed on the current line. They also accept a numeric argument as a repeat @@ -511,7 +512,8 @@ selected in one, and a previously current buffer (aside from @item b @findex Buffer-menu-bury @kindex b @r{(Buffer Menu)} -Bury this line's buffer (@code{Buffer-menu-bury}). +Bury this line's buffer (@code{Buffer-menu-bury}) (i.e., move it to +the end of the buffer list). @item m @findex Buffer-menu-mark @@ -733,10 +735,10 @@ C-b}. To customize this buffer list, use the @code{bs} Custom group @kindex C-Down-mouse-1 MSB global minor mode (``MSB'' stands for ``mouse select buffer'') provides a different and customizable mouse buffer menu which you may -prefer. It replaces the bindings of @code{mouse-buffer-menu}, -normally on @kbd{C-Down-mouse-1} and @kbd{C-@key{F10}}, and the menu -bar buffer menu. You can customize the menu in the @code{msb} Custom -group. +prefer. It replaces the @code{mouse-buffer-menu} commands, normally +bound to @kbd{C-Down-mouse-1} and @kbd{C-@key{F10}}, with its own +commands, and also modifies the menu-bar buffer menu. You can +customize the menu in the @code{msb} Custom group. @findex ibuffer IBuffer is a major mode for viewing a list of buffers and operating commit c2e6d121ff0df7f0b5eee7bec7f4b114befa8cde Author: tino calancha Date: Sun Jan 21 13:34:55 2018 +0900 * lisp/term.el (term-send-input): Fix text duplication in docstring diff --git a/lisp/term.el b/lisp/term.el index 0492763854..078a4baff5 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2049,16 +2049,13 @@ After the process output mark, sends all text from the process mark to point as input to the process. Before the process output mark, calls value of variable `term-get-old-input' to retrieve old input, copies it to the process mark, and sends it. A terminal newline is also inserted into the -buffer and sent to the process. The list of function names contained in the -value of `term-input-filter-functions' is called on the input before sending -it. The input is entered into the input history ring, if the value of variable -`term-input-filter' returns non-nil when called on the input. - -Any history reference may be expanded depending on the value of the variable -`term-input-autoexpand'. The list of function names contained in the value -of `term-input-filter-functions' is called on the input before sending it. +buffer and sent to the process. The functions in `term-input-filter-functions' +are called on the input before sending it. + The input is entered into the input history ring, if the value of variable -`term-input-filter' returns non-nil when called on the input. +`term-input-filter' returns non-nil when called on the input. Any history +reference may be expanded depending on the value of the variable +`term-input-autoexpand'. If variable `term-eol-on-send' is non-nil, then point is moved to the end of line before sending the input. commit 854a1c0a61c8754beab95734db772298bc60cbea Author: Eli Zaretskii Date: Sat Jan 20 21:37:30 2018 +0200 Improve "Buffers" in the user manual Suggested by John Cummings in emacs-manual-bugs@gnu.org: * doc/emacs/buffers.texi (Select Buffer): Add cross-references to "Windows" and "Frames". (Misc Buffer, Kill Buffer): Use BUFFER consistently in commands that accept buffer names. (Select Buffer): Improve description of "M-g M-g". Improve wording. (Misc Buffer, Kill Buffer): Improve wording. (Kill Buffer): Fix the response required by kill-some-buffers. Mention customizable options that control what clean-buffer-list does. (Several Buffers): More detail about 'Buffer-menu-unmark-all-buffers'. diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi index 47ac8d4b05..6a8e32bc84 100644 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi @@ -81,7 +81,7 @@ Select the next buffer in the buffer list (@code{next-buffer}). @item C-u M-g M-g @itemx C-u M-g g Read a number @var{n} and move to line @var{n} in the most recently -selected buffer other than the current buffer. +selected buffer other than the current buffer, in another window. @end table @kindex C-x b @@ -94,12 +94,12 @@ now displayed in any window. While entering the buffer name, you can use the usual completion and history commands (@pxref{Minibuffer}). Note that @kbd{C-x b}, and -related commands, use @dfn{permissive completion with confirmation} for -minibuffer completion: if you type @key{RET} immediately after -completing up to a nonexistent buffer name, Emacs prints -@samp{[Confirm]} and you must type a second @key{RET} to submit that -buffer name. @xref{Completion Exit}, for details. For other -completion options and features, see @ref{Completion Options}. +related commands, use @dfn{permissive completion with confirmation} +for minibuffer completion: if you type @key{RET} when the minibuffer +text names a nonexistent buffer, Emacs prints @samp{[Confirm]} and you +must type a second @key{RET} to submit that buffer name. +@xref{Completion Exit}, for details. For other completion options and +features, see @ref{Completion Options}. If you specify a buffer that does not exist, @kbd{C-x b} creates a new, empty buffer that is not visiting any file, and selects it for @@ -124,18 +124,19 @@ direction. @kindex C-x 4 b @findex switch-to-buffer-other-window - To select a buffer in a window other than the current one, type -@kbd{C-x 4 b} (@code{switch-to-buffer-other-window}). This prompts -for a buffer name using the minibuffer, displays that buffer in -another window, and selects that window. + To select a buffer in a window other than the current one +(@pxref{Windows}), type @kbd{C-x 4 b} +(@code{switch-to-buffer-other-window}). This prompts for a buffer +name using the minibuffer, displays that buffer in another window, and +selects that window. @kindex C-x 5 b @findex switch-to-buffer-other-frame Similarly, @kbd{C-x 5 b} (@code{switch-to-buffer-other-frame}) -prompts for a buffer name, displays that buffer in another frame, and -selects that frame. If the buffer is already being shown in a window -on another frame, Emacs selects that window and frame instead of -creating a new frame. +prompts for a buffer name, displays that buffer in another frame +(@pxref{Frames}), and selects that frame. If the buffer is already +being shown in a window on another frame, Emacs selects that window +and frame instead of creating a new frame. @xref{Displaying Buffers}, for how the @kbd{C-x 4 b} and @kbd{C-x 5 b} commands get the window and/or frame to display in. @@ -219,7 +220,7 @@ unless they visit files: such buffers are used internally by Emacs. @table @kbd @item C-x C-q Toggle read-only status of buffer (@code{read-only-mode}). -@item M-x rename-buffer @key{RET} @var{name} @key{RET} +@item M-x rename-buffer @key{RET} @var{buffer} @key{RET} Change the name of the current buffer. @item M-x rename-uniquely Rename the current buffer by adding @samp{<@var{number}>} to the end. @@ -234,8 +235,9 @@ Scroll through buffer @var{buffer}. @xref{View Mode}. its contents are not allowed. The mode line indicates read-only buffers with @samp{%%} or @samp{%*} near the left margin. @xref{Mode Line}. Read-only buffers are usually made by subsystems such as Dired -and Rmail that have special commands to operate on the text; also by -visiting a file whose access control says you cannot write it. +and Rmail that have special commands to operate on the text. Visiting +a file whose access control says you cannot write it also makes the +buffer read-only. @findex read-only-mode @vindex view-read-only @@ -282,13 +284,13 @@ large number of buffers. You may then find it convenient to @dfn{kill} the buffers you no longer need. (Some other editors call this operation @dfn{close}, and talk about ``closing the buffer'' or ``closing the file'' visited in the buffer.) On most operating -systems, killing a buffer releases its space back to the operating -system so that other programs can use it. Here are some commands for -killing buffers: +systems, killing a buffer releases the memory Emacs used for the buffer +back to the operating system so that other programs can use it. Here +are some commands for killing buffers: @table @kbd -@item C-x k @var{bufname} @key{RET} -Kill buffer @var{bufname} (@code{kill-buffer}). +@item C-x k @var{buffer} @key{RET} +Kill buffer @var{buffer} (@code{kill-buffer}). @item M-x kill-some-buffers Offer to kill each buffer, one by one. @item M-x kill-matching-buffers @@ -307,7 +309,7 @@ confirm with @kbd{yes} before the buffer is killed. @findex kill-some-buffers The command @kbd{M-x kill-some-buffers} asks about each buffer, one -by one. An answer of @kbd{y} means to kill the buffer, just like +by one. An answer of @kbd{yes} means to kill the buffer, just like @code{kill-buffer}. This command ignores buffers whose names begin with a space, which are used internally by Emacs. @@ -335,7 +337,9 @@ all the unmodified buffers that you have not used for a long time. An ordinary buffer is killed if it has not been displayed for three days; however, you can specify certain buffers that should never be killed automatically, and others that should be killed if they have been unused -for a mere hour. +for a mere hour. These defaults, and other aspects of this command's +behavior, can be controlled by customizing several options described +in the doc string of @code{clean-buffer-list}. @cindex Midnight mode @vindex midnight-mode @@ -422,7 +426,9 @@ Move to the previous line and remove all flags on that line @findex Buffer-menu-unmark-all-buffers @kindex M-DEL @r{(Buffer Menu)} Remove a particular flag from all lines -(@code{Buffer-menu-unmark-all-buffers}). +(@code{Buffer-menu-unmark-all-buffers}). This asks for a single +character, and unmarks buffers marked with that character; typing +@key{RET} removes all marks. @item U @findex Buffer-menu-unmark-all