diff options
| author | Michael R. Mauger | 2017-07-07 16:26:35 -0400 |
|---|---|---|
| committer | Michael R. Mauger | 2017-07-07 16:26:35 -0400 |
| commit | eb27fc4d49e8c914cd0e6a8a2d02159601542141 (patch) | |
| tree | f57209aa49d05f15c3d71563d2021a38935c663d | |
| parent | 7f62a4a7440aee6aacf04036feb3384a6515e48f (diff) | |
| parent | c24748ada08ffdb2921826f2b954a230e25d1d60 (diff) | |
| download | emacs-eb27fc4d49e8c914cd0e6a8a2d02159601542141.tar.gz emacs-eb27fc4d49e8c914cd0e6a8a2d02159601542141.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
42 files changed, 739 insertions, 243 deletions
diff --git a/ChangeLog.2 b/ChangeLog.2 index 96a647d9b44..bf52ac0ef1d 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 | |||
| @@ -16541,7 +16541,7 @@ | |||
| 16541 | * lisp/faces.el (faces--attribute-at-point): Fix an issue | 16541 | * lisp/faces.el (faces--attribute-at-point): Fix an issue |
| 16542 | 16542 | ||
| 16543 | Previous code would signal an error when the face at point was | 16543 | Previous code would signal an error when the face at point was |
| 16544 | a manually built list of attributes such as '(:foregroud "white"). | 16544 | a manually built list of attributes such as '(:foreground "white"). |
| 16545 | 16545 | ||
| 16546 | * test/automated/faces-tests.el (faces--test-color-at-point): Add a test | 16546 | * test/automated/faces-tests.el (faces--test-color-at-point): Add a test |
| 16547 | 16547 | ||
| @@ -32017,10 +32017,10 @@ | |||
| 32017 | 32017 | ||
| 32018 | 2015-05-18 Dmitry Gutov <dgutov@yandex.ru> | 32018 | 2015-05-18 Dmitry Gutov <dgutov@yandex.ru> |
| 32019 | 32019 | ||
| 32020 | Add a test case for Maven warning ouput | 32020 | Add a test case for Maven warning output |
| 32021 | * test/automated/compile-tests.el | 32021 | * test/automated/compile-tests.el |
| 32022 | (compile-tests--test-regexps-data): Add a case for Maven warning | 32022 | (compile-tests--test-regexps-data): Add a case for Maven warning |
| 32023 | ouput. | 32023 | output. |
| 32024 | (compile--test-error-line): Check the compilation message type, if | 32024 | (compile--test-error-line): Check the compilation message type, if |
| 32025 | it's specified in the test data. | 32025 | it's specified in the test data. |
| 32026 | 32026 | ||
| @@ -32142,7 +32142,7 @@ | |||
| 32142 | (xpm_load): Call the above functions. Handle XPM without mask | 32142 | (xpm_load): Call the above functions. Handle XPM without mask |
| 32143 | when USE_CAIRO. | 32143 | when USE_CAIRO. |
| 32144 | (png_load_body): Handle USE_CAIRO case. | 32144 | (png_load_body): Handle USE_CAIRO case. |
| 32145 | (png_load): Remove USE_CAIRO specific fuction, modify png_load_body | 32145 | (png_load): Remove USE_CAIRO specific function, modify png_load_body |
| 32146 | instead. | 32146 | instead. |
| 32147 | (jpeg_load_body): Call create_cairo_image_surface. | 32147 | (jpeg_load_body): Call create_cairo_image_surface. |
| 32148 | (gif_load, svg_load_image): Handle specified background, call | 32148 | (gif_load, svg_load_image): Handle specified background, call |
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 0b5efd04a18..5165881739f 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi | |||
| @@ -521,7 +521,7 @@ data to the clipboard manager, change the variable | |||
| 521 | 521 | ||
| 522 | Since strings containing NUL bytes are usually truncated when passed | 522 | Since strings containing NUL bytes are usually truncated when passed |
| 523 | through the clipboard, Emacs replaces such characters with ``\0'' | 523 | through the clipboard, Emacs replaces such characters with ``\0'' |
| 524 | before transfering them to the system's clipboard. | 524 | before transferring them to the system's clipboard. |
| 525 | 525 | ||
| 526 | @vindex select-enable-primary | 526 | @vindex select-enable-primary |
| 527 | @findex clipboard-kill-region | 527 | @findex clipboard-kill-region |
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi index 0ac5b08c87b..6443464f0ed 100644 --- a/doc/lispref/hooks.texi +++ b/doc/lispref/hooks.texi | |||
| @@ -241,11 +241,6 @@ Redisplay}. | |||
| 241 | @itemx window-scroll-functions | 241 | @itemx window-scroll-functions |
| 242 | @itemx window-size-change-functions | 242 | @itemx window-size-change-functions |
| 243 | @xref{Window Hooks}. | 243 | @xref{Window Hooks}. |
| 244 | |||
| 245 | @item window-text-change-functions | ||
| 246 | @vindex window-text-change-functions | ||
| 247 | Functions to call in redisplay when text in the window might change. | ||
| 248 | |||
| 249 | @end table | 244 | @end table |
| 250 | 245 | ||
| 251 | @ignore | 246 | @ignore |
diff --git a/doc/misc/org.texi b/doc/misc/org.texi index e3f8962c896..e1de3087311 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi | |||
| @@ -1983,7 +1983,7 @@ you can use the usual commands to follow these links. | |||
| 1983 | @item C-c ' | 1983 | @item C-c ' |
| 1984 | @item C-c ' | 1984 | @item C-c ' |
| 1985 | Edit the footnote definition corresponding to the reference at point in | 1985 | Edit the footnote definition corresponding to the reference at point in |
| 1986 | a seperate window. The window can be closed by pressing @kbd{C-c '}. | 1986 | a separate window. The window can be closed by pressing @kbd{C-c '}. |
| 1987 | 1987 | ||
| 1988 | @end table | 1988 | @end table |
| 1989 | 1989 | ||
| @@ -5291,7 +5291,7 @@ or with a tree they need to be inserted into a special drawer | |||
| 5291 | right below a headline, and its planning line (@pxref{Deadlines and | 5291 | right below a headline, and its planning line (@pxref{Deadlines and |
| 5292 | scheduling}) when applicable. Each property is specified on a single line, | 5292 | scheduling}) when applicable. Each property is specified on a single line, |
| 5293 | with the key (surrounded by colons) first, and the value after it. Keys are | 5293 | with the key (surrounded by colons) first, and the value after it. Keys are |
| 5294 | case-insensitives. Here is an example: | 5294 | case-insensitive. Here is an example: |
| 5295 | 5295 | ||
| 5296 | @example | 5296 | @example |
| 5297 | * CD collection | 5297 | * CD collection |
| @@ -6218,7 +6218,7 @@ format is shorter, things do work as expected. | |||
| 6218 | @section Deadlines and scheduling | 6218 | @section Deadlines and scheduling |
| 6219 | 6219 | ||
| 6220 | A timestamp may be preceded by special keywords to facilitate planning. Both | 6220 | A timestamp may be preceded by special keywords to facilitate planning. Both |
| 6221 | the timestamp and the keyword have to be positioned immediatly after the task | 6221 | the timestamp and the keyword have to be positioned immediately after the task |
| 6222 | they refer to. | 6222 | they refer to. |
| 6223 | 6223 | ||
| 6224 | @table @var | 6224 | @table @var |
| @@ -10011,7 +10011,7 @@ completions. If you need such a symbol inside a word, terminate it with | |||
| 10011 | a pair of curly brackets. For example | 10011 | a pair of curly brackets. For example |
| 10012 | 10012 | ||
| 10013 | @example | 10013 | @example |
| 10014 | Protip: Given a circle \Gamma of diameter d, the length of its circumference | 10014 | Pro tip: Given a circle \Gamma of diameter d, the length of its circumference |
| 10015 | is \pi@{@}d. | 10015 | is \pi@{@}d. |
| 10016 | @end example | 10016 | @end example |
| 10017 | 10017 | ||
| @@ -11395,7 +11395,7 @@ transcoding @LaTeX{} fragments to images (@pxref{Math formatting in HTML | |||
| 11395 | export}). | 11395 | export}). |
| 11396 | 11396 | ||
| 11397 | @item SUBTITLE | 11397 | @item SUBTITLE |
| 11398 | @cindex #+SUBTILE (HTML) | 11398 | @cindex #+SUBTITLE (HTML) |
| 11399 | The document's subtitle. HTML exporter formats subtitle if document type is | 11399 | The document's subtitle. HTML exporter formats subtitle if document type is |
| 11400 | @samp{HTML5} and the CSS has a @samp{subtitle} class. | 11400 | @samp{HTML5} and the CSS has a @samp{subtitle} class. |
| 11401 | @end table | 11401 | @end table |
| @@ -11692,7 +11692,7 @@ buffer. For example, with the following settings, | |||
| 11692 | @smallexample | 11692 | @smallexample |
| 11693 | #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler | 11693 | #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler |
| 11694 | @end smallexample | 11694 | @end smallexample |
| 11695 | equation labels will be displayed on the left marign and equations will be | 11695 | equation labels will be displayed on the left margin and equations will be |
| 11696 | five ems from the left margin. | 11696 | five ems from the left margin. |
| 11697 | 11697 | ||
| 11698 | @noindent See the docstring of | 11698 | @noindent See the docstring of |
| @@ -17679,7 +17679,7 @@ thes variable, @code{org-imenu-depth}. | |||
| 17679 | @cindex Ludlam, Eric M. | 17679 | @cindex Ludlam, Eric M. |
| 17680 | Speedbar package creates a special Emacs frame for displaying files and index | 17680 | Speedbar package creates a special Emacs frame for displaying files and index |
| 17681 | items in files. Org mode supports Speedbar; users can drill into Org files | 17681 | items in files. Org mode supports Speedbar; users can drill into Org files |
| 17682 | directly from the Speedbar. The @kbd{<} in the Speedbar frame tweeks the | 17682 | directly from the Speedbar. The @kbd{<} in the Speedbar frame tweaks the |
| 17683 | agenda commands to that file or to a subtree. | 17683 | agenda commands to that file or to a subtree. |
| 17684 | @cindex @file{table.el} | 17684 | @cindex @file{table.el} |
| 17685 | @item @file{table.el} by Takaaki Ota | 17685 | @item @file{table.el} by Takaaki Ota |
| @@ -18459,7 +18459,7 @@ meaningful string suitable for the agenda view. | |||
| 18459 | @vindex org-agenda-skip-function | 18459 | @vindex org-agenda-skip-function |
| 18460 | 18460 | ||
| 18461 | Search for entries with a limit set on levels for the custom search. This is | 18461 | Search for entries with a limit set on levels for the custom search. This is |
| 18462 | a general appraoch to creating custom searches in Org. To include all | 18462 | a general approach to creating custom searches in Org. To include all |
| 18463 | levels, use @samp{LEVEL>0}@footnote{Note that, for | 18463 | levels, use @samp{LEVEL>0}@footnote{Note that, for |
| 18464 | @code{org-odd-levels-only}, a level number corresponds to order in the | 18464 | @code{org-odd-levels-only}, a level number corresponds to order in the |
| 18465 | hierarchy, not to the number of stars.}. Then to selectively pick the | 18465 | hierarchy, not to the number of stars.}. Then to selectively pick the |
| @@ -19116,7 +19116,7 @@ calculations and improved XEmacs compatibility, in particular by porting | |||
| 19116 | @file{nouline.el} to XEmacs. | 19116 | @file{nouline.el} to XEmacs. |
| 19117 | @item | 19117 | @item |
| 19118 | @i{Sacha Chua} suggested copying some linking code from Planner, and helped | 19118 | @i{Sacha Chua} suggested copying some linking code from Planner, and helped |
| 19119 | make Org pupular through her blog. | 19119 | make Org popular through her blog. |
| 19120 | @item | 19120 | @item |
| 19121 | @i{Toby S. Cubitt} contributed to the code for clock formats. | 19121 | @i{Toby S. Cubitt} contributed to the code for clock formats. |
| 19122 | @item | 19122 | @item |
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 87c6458ae4c..f8399dbf1e8 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS | |||
| @@ -20,7 +20,7 @@ above is suggested. | |||
| 20 | *** XEmacs support has been dropped | 20 | *** XEmacs support has been dropped |
| 21 | 21 | ||
| 22 | Incomplete compatibility layer with XEmacs has been removed. If you | 22 | Incomplete compatibility layer with XEmacs has been removed. If you |
| 23 | want to take over maintainance of this compatibility, please contact | 23 | want to take over maintenance of this compatibility, please contact |
| 24 | our mailing list. | 24 | our mailing list. |
| 25 | 25 | ||
| 26 | *** New syntax for export blocks | 26 | *** New syntax for export blocks |
| @@ -117,7 +117,7 @@ exists. | |||
| 117 | *** ~org-file-apps~ no longer accepts S-expressions as commands | 117 | *** ~org-file-apps~ no longer accepts S-expressions as commands |
| 118 | 118 | ||
| 119 | The variable now accepts functions of two arguments instead of plain | 119 | The variable now accepts functions of two arguments instead of plain |
| 120 | S-expressions. Replacing a S-expresion with an appropriate function | 120 | S-expressions. Replacing an S-expression with an appropriate function |
| 121 | is straightforward. For example | 121 | is straightforward. For example |
| 122 | 122 | ||
| 123 | : ("pdf" . (foo)) | 123 | : ("pdf" . (foo)) |
| @@ -198,7 +198,7 @@ entries are added to last in the date tree. | |||
| 198 | 198 | ||
| 199 | *** New ~vbar~ entity | 199 | *** New ~vbar~ entity |
| 200 | 200 | ||
| 201 | ~\vbar~ or ~\vbar{}~ will be exported unconditionnally as a =|=, | 201 | ~\vbar~ or ~\vbar{}~ will be exported unconditionally as a =|=, |
| 202 | unlike to existing ~\vert~, which is expanded as ~|~ when using | 202 | unlike to existing ~\vert~, which is expanded as ~|~ when using |
| 203 | a HTML derived export back-end. | 203 | a HTML derived export back-end. |
| 204 | 204 | ||
| @@ -579,7 +579,7 @@ is that spaces are allowed within the path. | |||
| 579 | *** ~:preparation-function~ called earlier during publishing | 579 | *** ~:preparation-function~ called earlier during publishing |
| 580 | 580 | ||
| 581 | Functions in this list are called before any file is associated to the | 581 | Functions in this list are called before any file is associated to the |
| 582 | current projet. Thus, they can be used to generate to be published | 582 | current project. Thus, they can be used to generate to be published |
| 583 | Org files. | 583 | Org files. |
| 584 | 584 | ||
| 585 | *** Function ~org-remove-indentation~ changes. | 585 | *** Function ~org-remove-indentation~ changes. |
| @@ -986,7 +986,7 @@ a source block. | |||
| 986 | *** New option in ASCII export | 986 | *** New option in ASCII export |
| 987 | 987 | ||
| 988 | Plain lists can have an extra margin by setting ~org-ascii-list-margin~ | 988 | Plain lists can have an extra margin by setting ~org-ascii-list-margin~ |
| 989 | variable to an appopriate integer. | 989 | variable to an appropriate integer. |
| 990 | 990 | ||
| 991 | *** New blocks in ASCII export | 991 | *** New blocks in ASCII export |
| 992 | 992 | ||
| @@ -1022,7 +1022,7 @@ more features. See docstring for details. | |||
| 1022 | *** New filter: ~org-export-filter-body-functions~ | 1022 | *** New filter: ~org-export-filter-body-functions~ |
| 1023 | 1023 | ||
| 1024 | Functions in this filter are applied on the body of the exported | 1024 | Functions in this filter are applied on the body of the exported |
| 1025 | document, befor wrapping it within the template. | 1025 | document, before wrapping it within the template. |
| 1026 | 1026 | ||
| 1027 | *** New :environment parameter when exporting example blocks to LaTeX | 1027 | *** New :environment parameter when exporting example blocks to LaTeX |
| 1028 | 1028 | ||
| @@ -1087,7 +1087,7 @@ property is inherited by children. | |||
| 1087 | 1087 | ||
| 1088 | *** Tables can be sorted with an arbitrary function | 1088 | *** Tables can be sorted with an arbitrary function |
| 1089 | 1089 | ||
| 1090 | It is now possible to specify a function, both programatically, | 1090 | It is now possible to specify a function, both programmatically, |
| 1091 | through a new optional argument, and interactively with ~f~ or ~F~ keys, | 1091 | through a new optional argument, and interactively with ~f~ or ~F~ keys, |
| 1092 | to sort a table. | 1092 | to sort a table. |
| 1093 | 1093 | ||
diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16 index 691b7945bf4..ffd99f7438c 100644 --- a/lisp/ChangeLog.16 +++ b/lisp/ChangeLog.16 | |||
| @@ -11992,11 +11992,11 @@ | |||
| 11992 | * progmodes/verilog-mode.el (verilog-pretty-expr): Don't line up | 11992 | * progmodes/verilog-mode.el (verilog-pretty-expr): Don't line up |
| 11993 | assignment with tests in ifs and for loops. | 11993 | assignment with tests in ifs and for loops. |
| 11994 | (verilog-extended-complete-re, verilog-complete-reg): Change so | 11994 | (verilog-extended-complete-re, verilog-complete-reg): Change so |
| 11995 | that DPI inport functions don't look like fuction declarations. | 11995 | that DPI inport functions don't look like function declarations. |
| 11996 | (verilog-pretty-expr): Don't line up assignment | 11996 | (verilog-pretty-expr): Don't line up assignment |
| 11997 | operations to the test and increment in if and for loops | 11997 | operations to the test and increment in if and for loops |
| 11998 | (verilog-extended-complete-re, verilog-complete-reg): Change so | 11998 | (verilog-extended-complete-re, verilog-complete-reg): Change so |
| 11999 | that DPI inport functions don't look like fuction declarations. | 11999 | that DPI inport functions don't look like function declarations. |
| 12000 | 12000 | ||
| 12001 | 2012-05-03 Kenichi Handa <handa@m17n.org> | 12001 | 2012-05-03 Kenichi Handa <handa@m17n.org> |
| 12002 | 12002 | ||
diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 01d12c26141..d1747bda3da 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el | |||
| @@ -934,7 +934,7 @@ Note that the MAX parameter is used so we can exit the parse early." | |||
| 934 | (or | 934 | (or |
| 935 | ;; the required list of keys is nil, or | 935 | ;; the required list of keys is nil, or |
| 936 | (null require) | 936 | (null require) |
| 937 | ;; every element of require is in n(ormalized) | 937 | ;; every element of require is in n (normalized) |
| 938 | (let ((n (nth 0 (auth-source-netrc-normalize | 938 | (let ((n (nth 0 (auth-source-netrc-normalize |
| 939 | (list alist) file)))) | 939 | (list alist) file)))) |
| 940 | (cl-loop for req in require | 940 | (cl-loop for req in require |
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 7b27e7049d1..235eb83e85b 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -1034,29 +1034,41 @@ empty line above the done items separator." | |||
| 1034 | (hl-line-mode -1) | 1034 | (hl-line-mode -1) |
| 1035 | (hl-line-mode 1)))) | 1035 | (hl-line-mode 1)))) |
| 1036 | 1036 | ||
| 1037 | (defvar todo--item-headers-hidden nil | ||
| 1038 | "Non-nil if item date-time headers in current buffer are hidden.") | ||
| 1039 | |||
| 1037 | (defun todo-toggle-item-header () | 1040 | (defun todo-toggle-item-header () |
| 1038 | "Hide or show item date-time headers in the current file. | 1041 | "Hide or show item date-time headers in the current file. |
| 1039 | With done items, this hides only the done date-time string, not | 1042 | With done items, this hides only the done date-time string, not |
| 1040 | the the original date-time string." | 1043 | the the original date-time string." |
| 1041 | (interactive) | 1044 | (interactive) |
| 1042 | (save-excursion | 1045 | (unless (catch 'nonempty |
| 1043 | (save-restriction | 1046 | (dolist (type '(todo done)) |
| 1044 | (goto-char (point-min)) | 1047 | (dolist (c todo-categories) |
| 1045 | (let ((ov (todo-get-overlay 'header))) | 1048 | (let ((count (todo-get-count type (car c)))) |
| 1046 | (if ov | 1049 | (unless (zerop count) |
| 1047 | (remove-overlays 1 (1+ (buffer-size)) 'todo 'header) | 1050 | (throw 'nonempty t)))))) |
| 1048 | (widen) | 1051 | (user-error "This file has no items")) |
| 1049 | (goto-char (point-min)) | 1052 | (if todo--item-headers-hidden |
| 1050 | (while (not (eobp)) | 1053 | (progn |
| 1051 | (when (re-search-forward | 1054 | (remove-overlays 1 (1+ (buffer-size)) 'todo 'header) |
| 1052 | (concat todo-item-start | 1055 | (setq todo--item-headers-hidden nil)) |
| 1053 | "\\( " diary-time-regexp "\\)?" | 1056 | (save-excursion |
| 1054 | (regexp-quote todo-nondiary-end) "? ") | 1057 | (save-restriction |
| 1055 | nil t) | 1058 | (widen) |
| 1056 | (setq ov (make-overlay (match-beginning 0) (match-end 0) nil t)) | 1059 | (goto-char (point-min)) |
| 1057 | (overlay-put ov 'todo 'header) | 1060 | (let (ov) |
| 1058 | (overlay-put ov 'display "")) | 1061 | (while (not (eobp)) |
| 1059 | (todo-forward-item))))))) | 1062 | (when (re-search-forward |
| 1063 | (concat todo-item-start | ||
| 1064 | "\\( " diary-time-regexp "\\)?" | ||
| 1065 | (regexp-quote todo-nondiary-end) "? ") | ||
| 1066 | nil t) | ||
| 1067 | (setq ov (make-overlay (match-beginning 0) (match-end 0) nil t)) | ||
| 1068 | (overlay-put ov 'todo 'header) | ||
| 1069 | (overlay-put ov 'display "")) | ||
| 1070 | (forward-line))) | ||
| 1071 | (setq todo--item-headers-hidden t))))) | ||
| 1060 | 1072 | ||
| 1061 | ;; ----------------------------------------------------------------------------- | 1073 | ;; ----------------------------------------------------------------------------- |
| 1062 | ;;; File and category editing | 1074 | ;;; File and category editing |
| @@ -1731,46 +1743,49 @@ done items sections are visible, the sequence of N items can | |||
| 1731 | consist of the the last todo items and the first done items." | 1743 | consist of the the last todo items and the first done items." |
| 1732 | (interactive "p") | 1744 | (interactive "p") |
| 1733 | (when (todo-item-string) | 1745 | (when (todo-item-string) |
| 1734 | (unless (> n 1) (setq n 1)) | 1746 | (let ((cat (todo-current-category))) |
| 1735 | (catch 'end | 1747 | (unless (> n 1) (setq n 1)) |
| 1736 | (dotimes (i n) | 1748 | (catch 'end |
| 1737 | (let* ((cat (todo-current-category)) | 1749 | (dotimes (i n) |
| 1738 | (marks (assoc cat todo-categories-with-marks)) | 1750 | (let* ((marks (assoc cat todo-categories-with-marks)) |
| 1739 | (ov (progn | 1751 | (ov (progn |
| 1740 | (unless (looking-at todo-item-start) | 1752 | (unless (looking-at todo-item-start) |
| 1741 | (todo-item-start)) | 1753 | (todo-item-start)) |
| 1742 | (todo-get-overlay 'prefix))) | 1754 | (todo-get-overlay 'prefix))) |
| 1743 | (pref (overlay-get ov 'before-string))) | 1755 | (pref (overlay-get ov 'before-string))) |
| 1744 | (if (todo-marked-item-p) | 1756 | (if (todo-marked-item-p) |
| 1745 | (progn | 1757 | (progn |
| 1746 | (overlay-put ov 'before-string (substring pref 1)) | 1758 | (overlay-put ov 'before-string (substring pref 1)) |
| 1747 | (if (= (cdr marks) 1) ; Deleted last mark in this category. | 1759 | (if (= (cdr marks) 1) ; Deleted last mark in this category. |
| 1748 | (setq todo-categories-with-marks | 1760 | (setq todo-categories-with-marks |
| 1749 | (assq-delete-all cat todo-categories-with-marks)) | 1761 | (assq-delete-all cat todo-categories-with-marks)) |
| 1750 | (setcdr marks (1- (cdr marks))))) | 1762 | (setcdr marks (1- (cdr marks))))) |
| 1751 | (overlay-put ov 'before-string (concat todo-item-mark pref)) | 1763 | (overlay-put ov 'before-string (concat todo-item-mark pref)) |
| 1752 | (if marks | 1764 | (if marks |
| 1753 | (setcdr marks (1+ (cdr marks))) | 1765 | (setcdr marks (1+ (cdr marks))) |
| 1754 | (push (cons cat 1) todo-categories-with-marks)))) | 1766 | (push (cons cat 1) todo-categories-with-marks)))) |
| 1755 | (todo-forward-item) | 1767 | (todo-forward-item) |
| 1756 | ;; Don't try to mark the empty lines at the end of the todo | 1768 | ;; Don't try to mark the empty lines at the end of the todo |
| 1757 | ;; and done items sections. | 1769 | ;; and done items sections. |
| 1758 | (when (looking-at "^$") | 1770 | (when (looking-at "^$") |
| 1759 | (if (eobp) | 1771 | (if (eobp) |
| 1760 | (throw 'end nil) | 1772 | (throw 'end nil) |
| 1761 | (todo-forward-item))))))) | 1773 | (todo-forward-item)))))))) |
| 1762 | 1774 | ||
| 1763 | (defun todo-mark-category () | 1775 | (defun todo-mark-category () |
| 1764 | "Mark all visible items in this category with `todo-item-mark'." | 1776 | "Mark all visible items in this category with `todo-item-mark'." |
| 1765 | (interactive) | 1777 | (interactive) |
| 1766 | (let* ((cat (todo-current-category)) | 1778 | (let ((cat (todo-current-category))) |
| 1767 | (marks (assoc cat todo-categories-with-marks))) | ||
| 1768 | (save-excursion | 1779 | (save-excursion |
| 1769 | (goto-char (point-min)) | 1780 | (goto-char (point-min)) |
| 1770 | (while (not (eobp)) | 1781 | (while (not (eobp)) |
| 1771 | (let* ((ov (todo-get-overlay 'prefix)) | 1782 | (let* ((marks (assoc cat todo-categories-with-marks)) |
| 1772 | (pref (overlay-get ov 'before-string))) | 1783 | (ov (todo-get-overlay 'prefix)) |
| 1773 | (unless (todo-marked-item-p) | 1784 | ;; When done items are shown and there are no todo items, the |
| 1785 | ;; loop starts on the empty line in the todo items sections, | ||
| 1786 | ;; which has no overlay, so don't try to get it. | ||
| 1787 | (pref (when ov (overlay-get ov 'before-string)))) | ||
| 1788 | (unless (or (todo-marked-item-p) (not ov)) | ||
| 1774 | (overlay-put ov 'before-string (concat todo-item-mark pref)) | 1789 | (overlay-put ov 'before-string (concat todo-item-mark pref)) |
| 1775 | (if marks | 1790 | (if marks |
| 1776 | (setcdr marks (1+ (cdr marks))) | 1791 | (setcdr marks (1+ (cdr marks))) |
| @@ -1791,7 +1806,7 @@ consist of the the last todo items and the first done items." | |||
| 1791 | (goto-char (point-min)) | 1806 | (goto-char (point-min)) |
| 1792 | (while (not (eobp)) | 1807 | (while (not (eobp)) |
| 1793 | (let* ((ov (todo-get-overlay 'prefix)) | 1808 | (let* ((ov (todo-get-overlay 'prefix)) |
| 1794 | ;; No overlay on empty line between todo and done items. | 1809 | ;; See comment above in `todo-mark-category'. |
| 1795 | (pref (when ov (overlay-get ov 'before-string)))) | 1810 | (pref (when ov (overlay-get ov 'before-string)))) |
| 1796 | (when (todo-marked-item-p) | 1811 | (when (todo-marked-item-p) |
| 1797 | (overlay-put ov 'before-string (substring pref 1))) | 1812 | (overlay-put ov 'before-string (substring pref 1))) |
| @@ -2513,7 +2528,7 @@ numerical prefix argument, or noninteractively by argument ARG, | |||
| 2513 | whose value can be either of the symbols `raise' or `lower', | 2528 | whose value can be either of the symbols `raise' or `lower', |
| 2514 | meaning to raise or lower the item's priority by one." | 2529 | meaning to raise or lower the item's priority by one." |
| 2515 | (interactive) | 2530 | (interactive) |
| 2516 | (unless (and (called-interactively-p 'any) | 2531 | (unless (and (or (called-interactively-p 'any) (memq arg '(raise lower))) |
| 2517 | (or (todo-done-item-p) (looking-at "^$"))) | 2532 | (or (todo-done-item-p) (looking-at "^$"))) |
| 2518 | (let* ((item (or item (todo-item-string))) | 2533 | (let* ((item (or item (todo-item-string))) |
| 2519 | (marked (todo-marked-item-p)) | 2534 | (marked (todo-marked-item-p)) |
| @@ -2530,7 +2545,7 @@ meaning to raise or lower the item's priority by one." | |||
| 2530 | (re-search-forward regexp1 nil t) | 2545 | (re-search-forward regexp1 nil t) |
| 2531 | (match-string-no-properties 1))))))) | 2546 | (match-string-no-properties 1))))))) |
| 2532 | curnum | 2547 | curnum |
| 2533 | (todo (cond ((or (eq arg 'raise) (eq arg 'lower) | 2548 | (todo (cond ((or (memq arg '(raise lower)) |
| 2534 | (eq major-mode 'todo-filtered-items-mode)) | 2549 | (eq major-mode 'todo-filtered-items-mode)) |
| 2535 | (save-excursion | 2550 | (save-excursion |
| 2536 | (let ((curstart (todo-item-start)) | 2551 | (let ((curstart (todo-item-start)) |
| @@ -2670,7 +2685,7 @@ section in the category moved to." | |||
| 2670 | (num todo-category-number) | 2685 | (num todo-category-number) |
| 2671 | (item (todo-item-string)) | 2686 | (item (todo-item-string)) |
| 2672 | (diary-item (todo-diary-item-p)) | 2687 | (diary-item (todo-diary-item-p)) |
| 2673 | (done-item (and (todo-done-item-p) (concat item "\n"))) | 2688 | (done-item (and (todo-done-item-p) item)) |
| 2674 | (omark (save-excursion (todo-item-start) (point-marker))) | 2689 | (omark (save-excursion (todo-item-start) (point-marker))) |
| 2675 | (todo 0) | 2690 | (todo 0) |
| 2676 | (diary 0) | 2691 | (diary 0) |
| @@ -2700,43 +2715,51 @@ section in the category moved to." | |||
| 2700 | (while (not (eobp)) | 2715 | (while (not (eobp)) |
| 2701 | (when (todo-marked-item-p) | 2716 | (when (todo-marked-item-p) |
| 2702 | (if (todo-done-item-p) | 2717 | (if (todo-done-item-p) |
| 2703 | (setq done-items (concat done-items | 2718 | (progn |
| 2704 | (todo-item-string) "\n") | 2719 | (push (todo-item-string) done-items) |
| 2705 | done (1+ done)) | 2720 | (setq done (1+ done))) |
| 2706 | (setq todo-items (concat todo-items | 2721 | (push (todo-item-string) todo-items) |
| 2707 | (todo-item-string) "\n") | 2722 | (setq todo (1+ todo)) |
| 2708 | todo (1+ todo)) | ||
| 2709 | (when (todo-diary-item-p) | 2723 | (when (todo-diary-item-p) |
| 2710 | (setq diary (1+ diary))))) | 2724 | (setq diary (1+ diary))))) |
| 2711 | (todo-forward-item)) | 2725 | (todo-forward-item)) |
| 2712 | ;; Chop off last newline of multiple todo item string, | 2726 | (setq todo-items (nreverse todo-items)) |
| 2713 | ;; since it will be reinserted when setting priority | 2727 | (setq done-items (nreverse done-items))) |
| 2714 | ;; (but with done items priority is not set, so keep | ||
| 2715 | ;; last newline). | ||
| 2716 | (and todo-items | ||
| 2717 | (setq todo-items (substring todo-items 0 -1)))) | ||
| 2718 | (if (todo-done-item-p) | 2728 | (if (todo-done-item-p) |
| 2719 | (setq done 1) | 2729 | (progn |
| 2720 | (setq todo 1) | 2730 | (push done-item done-items) |
| 2731 | (setq done 1)) | ||
| 2732 | (push item todo-items) | ||
| 2733 | (setq todo 1) | ||
| 2721 | (when (todo-diary-item-p) (setq diary 1)))) | 2734 | (when (todo-diary-item-p) (setq diary 1)))) |
| 2722 | (set-window-buffer (selected-window) | 2735 | (set-window-buffer (selected-window) |
| 2723 | (set-buffer (find-file-noselect file2 'nowarn))) | 2736 | (set-buffer (find-file-noselect file2 'nowarn))) |
| 2724 | (unwind-protect | 2737 | (unwind-protect |
| 2725 | (progn | 2738 | (let (here) |
| 2726 | (when (or todo-items (and item (not done-item))) | 2739 | (when todo-items |
| 2727 | (todo-set-item-priority (or todo-items item) cat2 t)) | 2740 | (todo-set-item-priority (pop todo-items) cat2 t) |
| 2741 | (setq here (point)) | ||
| 2742 | (while todo-items | ||
| 2743 | (todo-forward-item) | ||
| 2744 | (todo-insert-with-overlays (pop todo-items)))) | ||
| 2728 | ;; Move done items en bloc to top of done items section. | 2745 | ;; Move done items en bloc to top of done items section. |
| 2729 | (when (or done-items done-item) | 2746 | (when done-items |
| 2730 | (todo-category-number cat2) | 2747 | (todo-category-number cat2) |
| 2731 | (widen) | 2748 | (widen) |
| 2732 | (goto-char (point-min)) | 2749 | (goto-char (point-min)) |
| 2733 | (re-search-forward | 2750 | (re-search-forward |
| 2734 | (concat "^" (regexp-quote (concat todo-category-beg cat2)) | 2751 | (concat "^" (regexp-quote (concat todo-category-beg cat2)) "$") |
| 2735 | "$") nil t) | 2752 | nil t) |
| 2736 | (re-search-forward | 2753 | (re-search-forward |
| 2737 | (concat "^" (regexp-quote todo-category-done)) nil t) | 2754 | (concat "^" (regexp-quote todo-category-done)) nil t) |
| 2738 | (forward-line) | 2755 | (forward-line) |
| 2739 | (insert (or done-items done-item))) | 2756 | (unless here (setq here (point))) |
| 2757 | (while done-items | ||
| 2758 | (todo-insert-with-overlays (pop done-items)) | ||
| 2759 | (todo-forward-item))) | ||
| 2760 | ;; If only done items were moved, move point to the top | ||
| 2761 | ;; one, otherwise, move point to the top moved todo item. | ||
| 2762 | (goto-char here) | ||
| 2740 | (setq moved t)) | 2763 | (setq moved t)) |
| 2741 | (cond | 2764 | (cond |
| 2742 | ;; Move succeeded, so remove item from starting category, | 2765 | ;; Move succeeded, so remove item from starting category, |
| @@ -2761,10 +2784,13 @@ section in the category moved to." | |||
| 2761 | (forward-line) | 2784 | (forward-line) |
| 2762 | (setq beg (point)) | 2785 | (setq beg (point)) |
| 2763 | (setq end (if (re-search-forward | 2786 | (setq end (if (re-search-forward |
| 2764 | (concat "^" (regexp-quote | 2787 | (concat "^" |
| 2765 | todo-category-beg)) nil t) | 2788 | (regexp-quote todo-category-beg)) |
| 2766 | (match-beginning 0) | 2789 | nil t) |
| 2767 | (point-max))) | 2790 | (progn |
| 2791 | (goto-char (match-beginning 0)) | ||
| 2792 | (point-marker)) | ||
| 2793 | (point-max-marker))) | ||
| 2768 | (goto-char beg) | 2794 | (goto-char beg) |
| 2769 | (while (< (point) end) | 2795 | (while (< (point) end) |
| 2770 | (if (todo-marked-item-p) | 2796 | (if (todo-marked-item-p) |
| @@ -2781,7 +2807,7 @@ section in the category moved to." | |||
| 2781 | (set-window-buffer (selected-window) | 2807 | (set-window-buffer (selected-window) |
| 2782 | (set-buffer (find-file-noselect file2 'nowarn))) | 2808 | (set-buffer (find-file-noselect file2 'nowarn))) |
| 2783 | (setq todo-category-number (todo-category-number cat2)) | 2809 | (setq todo-category-number (todo-category-number cat2)) |
| 2784 | (let ((todo-show-with-done (or done-items done-item))) | 2810 | (let ((todo-show-with-done (> done 0))) |
| 2785 | (todo-category-select)) | 2811 | (todo-category-select)) |
| 2786 | (goto-char nmark) | 2812 | (goto-char nmark) |
| 2787 | ;; If item is moved to end of (just first?) category, make | 2813 | ;; If item is moved to end of (just first?) category, make |
| @@ -2830,12 +2856,13 @@ visible." | |||
| 2830 | (goto-char (point-min)) | 2856 | (goto-char (point-min)) |
| 2831 | (re-search-forward todo-done-string-start nil t))) | 2857 | (re-search-forward todo-done-string-start nil t))) |
| 2832 | (buffer-read-only nil) | 2858 | (buffer-read-only nil) |
| 2833 | item done-item | 2859 | header item done-items |
| 2834 | (opoint (point))) | 2860 | (opoint (point))) |
| 2835 | ;; Don't add empty comment to done item. | 2861 | ;; Don't add empty comment to done item. |
| 2836 | (setq comment (unless (zerop (length comment)) | 2862 | (setq comment (unless (zerop (length comment)) |
| 2837 | (concat " [" todo-comment-string ": " comment "]"))) | 2863 | (concat " [" todo-comment-string ": " comment "]"))) |
| 2838 | (and marked (goto-char (point-min))) | 2864 | (and marked (goto-char (point-min))) |
| 2865 | (setq header (todo-get-overlay 'header)) | ||
| 2839 | (catch 'done | 2866 | (catch 'done |
| 2840 | ;; Stop looping when we hit the empty line below the last | 2867 | ;; Stop looping when we hit the empty line below the last |
| 2841 | ;; todo item (this is eobp if only done items are hidden). | 2868 | ;; todo item (this is eobp if only done items are hidden). |
| @@ -2843,17 +2870,15 @@ visible." | |||
| 2843 | (if (or (not marked) (and marked (todo-marked-item-p))) | 2870 | (if (or (not marked) (and marked (todo-marked-item-p))) |
| 2844 | (progn | 2871 | (progn |
| 2845 | (setq item (todo-item-string)) | 2872 | (setq item (todo-item-string)) |
| 2846 | (setq done-item (concat done-item done-prefix item | 2873 | (push (concat done-prefix item comment) done-items) |
| 2847 | comment (and marked "\n"))) | ||
| 2848 | (setq item-count (1+ item-count)) | 2874 | (setq item-count (1+ item-count)) |
| 2849 | (when (todo-diary-item-p) | 2875 | (when (todo-diary-item-p) |
| 2850 | (setq diary-count (1+ diary-count))) | 2876 | (setq diary-count (1+ diary-count))) |
| 2851 | (todo-remove-item) | 2877 | (todo-remove-item) |
| 2852 | (unless marked (throw 'done nil))) | 2878 | (unless marked (throw 'done nil))) |
| 2853 | (todo-forward-item)))) | 2879 | (todo-forward-item)))) |
| 2880 | (setq done-items (nreverse done-items)) | ||
| 2854 | (when marked | 2881 | (when marked |
| 2855 | ;; Chop off last newline of done item string. | ||
| 2856 | (setq done-item (substring done-item 0 -1)) | ||
| 2857 | (setq todo-categories-with-marks | 2882 | (setq todo-categories-with-marks |
| 2858 | (assq-delete-all cat todo-categories-with-marks))) | 2883 | (assq-delete-all cat todo-categories-with-marks))) |
| 2859 | (save-excursion | 2884 | (save-excursion |
| @@ -2862,7 +2887,17 @@ visible." | |||
| 2862 | (concat "^" (regexp-quote todo-category-done)) nil t) | 2887 | (concat "^" (regexp-quote todo-category-done)) nil t) |
| 2863 | (forward-char) | 2888 | (forward-char) |
| 2864 | (when show-done (setq opoint (point))) | 2889 | (when show-done (setq opoint (point))) |
| 2865 | (insert done-item "\n")) | 2890 | (while done-items |
| 2891 | (insert (pop done-items) "\n") | ||
| 2892 | (when header (let ((copy (copy-overlay header))) | ||
| 2893 | (re-search-backward | ||
| 2894 | (concat todo-item-start | ||
| 2895 | "\\( " diary-time-regexp "\\)?" | ||
| 2896 | (regexp-quote todo-nondiary-end) "? ") | ||
| 2897 | nil t) | ||
| 2898 | (move-overlay copy (match-beginning 0) (match-end 0))) | ||
| 2899 | (todo-item-end) | ||
| 2900 | (forward-char)))) | ||
| 2866 | (todo-update-count 'todo (- item-count)) | 2901 | (todo-update-count 'todo (- item-count)) |
| 2867 | (todo-update-count 'done item-count) | 2902 | (todo-update-count 'done item-count) |
| 2868 | (todo-update-count 'diary (- diary-count)) | 2903 | (todo-update-count 'diary (- diary-count)) |
| @@ -3089,7 +3124,9 @@ this category does not exist in the archive, it is created." | |||
| 3089 | (throw 'end (message "Only done items can be archived")) | 3124 | (throw 'end (message "Only done items can be archived")) |
| 3090 | (with-current-buffer archive | 3125 | (with-current-buffer archive |
| 3091 | (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode)) | 3126 | (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode)) |
| 3092 | (let (buffer-read-only) | 3127 | (let ((headers-hidden todo--item-headers-hidden) |
| 3128 | buffer-read-only) | ||
| 3129 | (if headers-hidden (todo-toggle-item-header)) | ||
| 3093 | (widen) | 3130 | (widen) |
| 3094 | (goto-char (point-min)) | 3131 | (goto-char (point-min)) |
| 3095 | (if (and (re-search-forward | 3132 | (if (and (re-search-forward |
| @@ -3115,7 +3152,8 @@ this category does not exist in the archive, it is created." | |||
| 3115 | (unless (nth 7 (file-attributes afile)) | 3152 | (unless (nth 7 (file-attributes afile)) |
| 3116 | (write-region nil nil afile t t) | 3153 | (write-region nil nil afile t t) |
| 3117 | (setq todo-archives (funcall todo-files-function t)) | 3154 | (setq todo-archives (funcall todo-files-function t)) |
| 3118 | (todo-archive-mode)))) | 3155 | (todo-archive-mode)) |
| 3156 | (if headers-hidden (todo-toggle-item-header)))) | ||
| 3119 | (with-current-buffer tbuf | 3157 | (with-current-buffer tbuf |
| 3120 | (cond | 3158 | (cond |
| 3121 | (all | 3159 | (all |
| @@ -3194,7 +3232,9 @@ the only category in the archive, the archive file is deleted." | |||
| 3194 | (todo-forward-item)))) | 3232 | (todo-forward-item)))) |
| 3195 | ;; Restore items to top of category's done section and update counts. | 3233 | ;; Restore items to top of category's done section and update counts. |
| 3196 | (with-current-buffer tbuf | 3234 | (with-current-buffer tbuf |
| 3197 | (let (buffer-read-only newcat) | 3235 | (let ((headers-hidden todo--item-headers-hidden) |
| 3236 | buffer-read-only newcat) | ||
| 3237 | (if headers-hidden (todo-toggle-item-header)) | ||
| 3198 | (widen) | 3238 | (widen) |
| 3199 | (goto-char (point-min)) | 3239 | (goto-char (point-min)) |
| 3200 | ;; Find the corresponding todo category, or if there isn't | 3240 | ;; Find the corresponding todo category, or if there isn't |
| @@ -3218,6 +3258,7 @@ the only category in the archive, the archive file is deleted." | |||
| 3218 | (todo-update-count 'done 1 cat) | 3258 | (todo-update-count 'done 1 cat) |
| 3219 | (unless newcat ; Newly added category has no archive. | 3259 | (unless newcat ; Newly added category has no archive. |
| 3220 | (todo-update-count 'archived -1 cat)))) | 3260 | (todo-update-count 'archived -1 cat)))) |
| 3261 | (if headers-hidden (todo-toggle-item-header)) | ||
| 3221 | (todo-update-categories-sexp))) | 3262 | (todo-update-categories-sexp))) |
| 3222 | ;; Delete restored items from archive. | 3263 | ;; Delete restored items from archive. |
| 3223 | (when marked | 3264 | (when marked |
| @@ -3263,6 +3304,10 @@ the only category in the archive, the archive file is deleted." | |||
| 3263 | (set-buffer (find-file-noselect tfile))) | 3304 | (set-buffer (find-file-noselect tfile))) |
| 3264 | (todo-category-number cat) | 3305 | (todo-category-number cat) |
| 3265 | (todo-category-select) | 3306 | (todo-category-select) |
| 3307 | ;; Selecting the category leaves point at the end of the done | ||
| 3308 | ;; items separator string, so move it to the (first) restored | ||
| 3309 | ;; done item. | ||
| 3310 | (forward-line) | ||
| 3266 | (message "Items unarchived."))))) | 3311 | (message "Items unarchived."))))) |
| 3267 | 3312 | ||
| 3268 | (defun todo-jump-to-archive-category (&optional file) | 3313 | (defun todo-jump-to-archive-category (&optional file) |
| @@ -5146,7 +5191,17 @@ empty line above the done items separator." | |||
| 5146 | (let* ((done (todo-done-item-p))) | 5191 | (let* ((done (todo-done-item-p))) |
| 5147 | (todo-item-start) | 5192 | (todo-item-start) |
| 5148 | (unless (bobp) | 5193 | (unless (bobp) |
| 5149 | (re-search-backward todo-item-start nil t (or count 1))) | 5194 | (re-search-backward (concat todo-item-start |
| 5195 | "\\( " diary-time-regexp "\\)?" | ||
| 5196 | (regexp-quote todo-nondiary-end) "? ") | ||
| 5197 | nil t (or count 1)) | ||
| 5198 | ;; If the item date-time header is hidden, the display engine | ||
| 5199 | ;; moves point to the next earlier displayable position, which | ||
| 5200 | ;; is the end of the next item above, so we move it to the start | ||
| 5201 | ;; of the current item's text (that's what the display engine | ||
| 5202 | ;; does with todo-forward-item in this case.) | ||
| 5203 | ;; FIXME: would it be better to use cursor-sensor-functions? | ||
| 5204 | (when todo--item-headers-hidden (goto-char (match-end 0)))) | ||
| 5150 | ;; Unless this is a regexp filtered items buffer (which can contain | 5205 | ;; Unless this is a regexp filtered items buffer (which can contain |
| 5151 | ;; intermixed todo and done items), if points advances by one from a | 5206 | ;; intermixed todo and done items), if points advances by one from a |
| 5152 | ;; done to a todo item, go back to the space above | 5207 | ;; done to a todo item, go back to the space above |
| @@ -5162,10 +5217,12 @@ empty line above the done items separator." | |||
| 5162 | 5217 | ||
| 5163 | (defun todo-remove-item () | 5218 | (defun todo-remove-item () |
| 5164 | "Internal function called in editing, deleting or moving items." | 5219 | "Internal function called in editing, deleting or moving items." |
| 5165 | (let* ((end (progn (todo-item-end) (1+ (point)))) | 5220 | (let ((end (progn (todo-item-end) (1+ (point)))) |
| 5166 | (beg (todo-item-start)) | 5221 | (beg (todo-item-start)) |
| 5167 | (ov (todo-get-overlay 'prefix))) | 5222 | ovs) |
| 5168 | (when ov (delete-overlay ov)) | 5223 | (push (todo-get-overlay 'prefix) ovs) |
| 5224 | (push (todo-get-overlay 'header) ovs) | ||
| 5225 | (dolist (ov ovs) (when ov (delete-overlay ov))) | ||
| 5169 | (delete-region beg end))) | 5226 | (delete-region beg end))) |
| 5170 | 5227 | ||
| 5171 | (defun todo-diary-item-p () | 5228 | (defun todo-diary-item-p () |
| @@ -5221,7 +5278,10 @@ Also preserve category display, if applicable." | |||
| 5221 | (let ((revert-buffer-function nil)) | 5278 | (let ((revert-buffer-function nil)) |
| 5222 | (revert-buffer ignore-auto noconfirm 'preserve-modes) | 5279 | (revert-buffer ignore-auto noconfirm 'preserve-modes) |
| 5223 | (when (memq major-mode '(todo-mode todo-archive-mode)) | 5280 | (when (memq major-mode '(todo-mode todo-archive-mode)) |
| 5224 | (todo-category-select)))) | 5281 | (save-excursion (todo-category-select)) |
| 5282 | ;; revert-buffer--default calls after-find-file, which makes | ||
| 5283 | ;; buffer writable. | ||
| 5284 | (setq buffer-read-only t)))) | ||
| 5225 | 5285 | ||
| 5226 | (defun todo-desktop-save-buffer (_dir) | 5286 | (defun todo-desktop-save-buffer (_dir) |
| 5227 | `((catnum . ,(todo-category-number (todo-current-category))))) | 5287 | `((catnum . ,(todo-category-number (todo-current-category))))) |
| @@ -5296,6 +5356,11 @@ marked) not done todo items." | |||
| 5296 | 5356 | ||
| 5297 | (defun todo-get-overlay (val) | 5357 | (defun todo-get-overlay (val) |
| 5298 | "Return the overlay at point whose `todo' property has value VAL." | 5358 | "Return the overlay at point whose `todo' property has value VAL." |
| 5359 | ;; When headers are hidden, the display engine makes item's start | ||
| 5360 | ;; inaccessible to commands, so go there here, if necessary, in | ||
| 5361 | ;; order to check for prefix and header overlays. | ||
| 5362 | (when (memq val '(prefix header)) | ||
| 5363 | (unless (looking-at todo-item-start) (todo-item-start))) | ||
| 5299 | ;; Use overlays-in to find prefix overlays and check over two | 5364 | ;; Use overlays-in to find prefix overlays and check over two |
| 5300 | ;; positions to find done separator overlay. | 5365 | ;; positions to find done separator overlay. |
| 5301 | (let ((ovs (overlays-in (point) (1+ (point)))) | 5366 | (let ((ovs (overlays-in (point) (1+ (point)))) |
| @@ -5320,16 +5385,26 @@ In that case, return the item's prefix overlay." | |||
| 5320 | (when marked ov))) | 5385 | (when marked ov))) |
| 5321 | 5386 | ||
| 5322 | (defun todo-insert-with-overlays (item) | 5387 | (defun todo-insert-with-overlays (item) |
| 5323 | "Insert ITEM at point and update prefix/priority number overlays." | 5388 | "Insert ITEM at point and update prefix and header overlays." |
| 5324 | (todo-item-start) | 5389 | (todo-item-start) |
| 5325 | ;; Insertion pushes item down but not its prefix overlay. When the | ||
| 5326 | ;; overlay includes a mark, this would now mark the inserted ITEM, | ||
| 5327 | ;; so move it to the pushed down item. | ||
| 5328 | (let ((ov (todo-get-overlay 'prefix)) | 5390 | (let ((ov (todo-get-overlay 'prefix)) |
| 5329 | (marked (todo-marked-item-p))) | 5391 | (marked (todo-marked-item-p))) |
| 5330 | (insert item "\n") | 5392 | (insert item "\n") |
| 5331 | (when marked (move-overlay ov (point) (point)))) | 5393 | ;; Insertion pushes item down but not its prefix overlay. When |
| 5332 | (todo-backward-item) | 5394 | ;; the overlay includes a mark, this would now mark the inserted |
| 5395 | ;; ITEM, so move it to the pushed down item. | ||
| 5396 | (when marked (move-overlay ov (point) (point))) | ||
| 5397 | (todo-backward-item) | ||
| 5398 | ;; With hidden headers, todo-backward-item puts point on first | ||
| 5399 | ;; visible character after header, so we have to search backward. | ||
| 5400 | (when todo--item-headers-hidden | ||
| 5401 | (re-search-backward (concat todo-item-start | ||
| 5402 | "\\( " diary-time-regexp "\\)?" | ||
| 5403 | (regexp-quote todo-nondiary-end) "? ") | ||
| 5404 | nil t) | ||
| 5405 | (setq ov (make-overlay (match-beginning 0) (match-end 0) nil t)) | ||
| 5406 | (overlay-put ov 'todo 'header) | ||
| 5407 | (overlay-put ov 'display ""))) | ||
| 5333 | (todo-prefix-overlays)) | 5408 | (todo-prefix-overlays)) |
| 5334 | 5409 | ||
| 5335 | (defun todo-prefix-overlays () | 5410 | (defun todo-prefix-overlays () |
| @@ -6594,6 +6669,7 @@ Added to `window-configuration-change-hook' in Todo mode." | |||
| 6594 | "Make some settings that apply to multiple Todo modes." | 6669 | "Make some settings that apply to multiple Todo modes." |
| 6595 | (add-to-invisibility-spec 'todo) | 6670 | (add-to-invisibility-spec 'todo) |
| 6596 | (setq buffer-read-only t) | 6671 | (setq buffer-read-only t) |
| 6672 | (setq-local todo--item-headers-hidden nil) | ||
| 6597 | (setq-local desktop-save-buffer 'todo-desktop-save-buffer) | 6673 | (setq-local desktop-save-buffer 'todo-desktop-save-buffer) |
| 6598 | (setq-local hl-line-range-function 'todo-hl-line-range)) | 6674 | (setq-local hl-line-range-function 'todo-hl-line-range)) |
| 6599 | 6675 | ||
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index e4547758587..095ce8ba89c 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -1399,7 +1399,7 @@ files matching `dired-omit-regexp'." | |||
| 1399 | ;; else try to find correct place to insert | 1399 | ;; else try to find correct place to insert |
| 1400 | (if (dired-goto-subdir directory) | 1400 | (if (dired-goto-subdir directory) |
| 1401 | (progn ;; unhide if necessary | 1401 | (progn ;; unhide if necessary |
| 1402 | (if (looking-at-p "\r") | 1402 | (if (= (following-char) ?\r) |
| 1403 | ;; Point is at end of subdir line. | 1403 | ;; Point is at end of subdir line. |
| 1404 | (dired-unhide-subdir)) | 1404 | (dired-unhide-subdir)) |
| 1405 | ;; found - skip subdir and `total' line | 1405 | ;; found - skip subdir and `total' line |
| @@ -2639,7 +2639,7 @@ Lower levels are unaffected." | |||
| 2639 | (and selective-display | 2639 | (and selective-display |
| 2640 | (save-excursion | 2640 | (save-excursion |
| 2641 | (dired-goto-subdir dir) | 2641 | (dired-goto-subdir dir) |
| 2642 | (looking-at-p "\r")))) | 2642 | (= (following-char) ?\r)))) |
| 2643 | 2643 | ||
| 2644 | ;;;###autoload | 2644 | ;;;###autoload |
| 2645 | (defun dired-hide-subdir (arg) | 2645 | (defun dired-hide-subdir (arg) |
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 527685acf37..7ceb672bf2f 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el | |||
| @@ -634,7 +634,7 @@ Optional fifth argument CASE-FOLD-P specifies the value of | |||
| 634 | (dired-mark-if | 634 | (dired-mark-if |
| 635 | (and | 635 | (and |
| 636 | ;; not already marked | 636 | ;; not already marked |
| 637 | (looking-at-p " ") | 637 | (= (following-char) ?\s) |
| 638 | ;; uninteresting | 638 | ;; uninteresting |
| 639 | (let ((fn (dired-get-filename localp t)) | 639 | (let ((fn (dired-get-filename localp t)) |
| 640 | ;; Match patterns case-insensitively on case-insensitive | 640 | ;; Match patterns case-insensitively on case-insensitive |
| @@ -1530,7 +1530,7 @@ refer at all to the underlying file system. Contrast this with | |||
| 1530 | (setq mode (buffer-substring (point) (+ mode-len (point)))) | 1530 | (setq mode (buffer-substring (point) (+ mode-len (point)))) |
| 1531 | (forward-char mode-len) | 1531 | (forward-char mode-len) |
| 1532 | ;; Skip any extended attributes marker ("." or "+"). | 1532 | ;; Skip any extended attributes marker ("." or "+"). |
| 1533 | (or (looking-at " ") | 1533 | (or (= (following-char) ?\s) |
| 1534 | (forward-char 1)) | 1534 | (forward-char 1)) |
| 1535 | (setq nlink (read (current-buffer))) | 1535 | (setq nlink (read (current-buffer))) |
| 1536 | ;; Karsten Wenger <kw@cis.uni-muenchen.de> fixed uid. | 1536 | ;; Karsten Wenger <kw@cis.uni-muenchen.de> fixed uid. |
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 985b7513a3b..fa25a0c3975 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -738,12 +738,14 @@ or to switch back to an existing one." | |||
| 738 | 738 | ||
| 739 | (defun lisp-comment-indent () | 739 | (defun lisp-comment-indent () |
| 740 | "Like `comment-indent-default', but don't put space after open paren." | 740 | "Like `comment-indent-default', but don't put space after open paren." |
| 741 | (let ((pt (point))) | 741 | (or (when (looking-at "\\s<\\s<") |
| 742 | (skip-syntax-backward " ") | 742 | (let ((pt (point))) |
| 743 | (if (eq (preceding-char) ?\() | 743 | (skip-syntax-backward " ") |
| 744 | (cons (current-column) (current-column)) | 744 | (if (eq (preceding-char) ?\() |
| 745 | (goto-char pt) | 745 | (cons (current-column) (current-column)) |
| 746 | (comment-indent-default)))) | 746 | (goto-char pt) |
| 747 | nil))) | ||
| 748 | (comment-indent-default))) | ||
| 747 | 749 | ||
| 748 | (define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1") | 750 | (define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1") |
| 749 | 751 | ||
diff --git a/lisp/erc/ChangeLog.2 b/lisp/erc/ChangeLog.2 index d961fbfd08a..6d789e4c93f 100644 --- a/lisp/erc/ChangeLog.2 +++ b/lisp/erc/ChangeLog.2 | |||
| @@ -120,7 +120,7 @@ | |||
| 120 | 120 | ||
| 121 | 2014-09-25 Kelvin White <kwhite@gnu.org> | 121 | 2014-09-25 Kelvin White <kwhite@gnu.org> |
| 122 | 122 | ||
| 123 | * erc.el: Follow Emacs version instead of tracking it seperately. | 123 | * erc.el: Follow Emacs version instead of tracking it separately. |
| 124 | (erc-quit/part-reason-default) : Clean up quit/part message | 124 | (erc-quit/part-reason-default) : Clean up quit/part message |
| 125 | functions by abstracting repetitive code, change version string. | 125 | functions by abstracting repetitive code, change version string. |
| 126 | (erc-quit-reason-various, erc-quit-reason-normal, erc-quit-reason-zippy) | 126 | (erc-quit-reason-various, erc-quit-reason-normal, erc-quit-reason-zippy) |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 32324ae3bcb..f5d94d8419f 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -1271,14 +1271,14 @@ BUFFER should be a buffer or a buffer name." | |||
| 1271 | (insert-file-contents file) | 1271 | (insert-file-contents file) |
| 1272 | (let (notfirst) | 1272 | (let (notfirst) |
| 1273 | (while (search-forward "" nil 'move) | 1273 | (while (search-forward "" nil 'move) |
| 1274 | (if (looking-at "S") | 1274 | (if (= (following-char) ?S) |
| 1275 | (delete-region (1- (point)) (line-end-position)) | 1275 | (delete-region (1- (point)) (line-end-position)) |
| 1276 | (delete-char -1) | 1276 | (delete-char -1) |
| 1277 | (if notfirst | 1277 | (if notfirst |
| 1278 | (insert "\n.DE\n") | 1278 | (insert "\n.DE\n") |
| 1279 | (setq notfirst t)) | 1279 | (setq notfirst t)) |
| 1280 | (insert "\n.SH ") | 1280 | (insert "\n.SH ") |
| 1281 | (insert (if (looking-at "F") "Function " "Variable ")) | 1281 | (insert (if (= (following-char) ?F) "Function " "Variable ")) |
| 1282 | (delete-char 1) | 1282 | (delete-char 1) |
| 1283 | (forward-line 1) | 1283 | (forward-line 1) |
| 1284 | (insert ".DS L\n")))) | 1284 | (insert ".DS L\n")))) |
| @@ -1304,7 +1304,7 @@ BUFFER should be a buffer or a buffer name." | |||
| 1304 | (forward-char 1)) | 1304 | (forward-char 1)) |
| 1305 | (goto-char (point-min)) | 1305 | (goto-char (point-min)) |
| 1306 | (while (search-forward "" nil t) | 1306 | (while (search-forward "" nil t) |
| 1307 | (unless (looking-at "S") | 1307 | (when (/= (following-char) ?S) |
| 1308 | (setq type (char-after) | 1308 | (setq type (char-after) |
| 1309 | name (buffer-substring (1+ (point)) (line-end-position)) | 1309 | name (buffer-substring (1+ (point)) (line-end-position)) |
| 1310 | doc (buffer-substring (line-beginning-position 2) | 1310 | doc (buffer-substring (line-beginning-position 2) |
diff --git a/lisp/mouse.el b/lisp/mouse.el index e0794435d7a..2fbaaadf16b 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -663,7 +663,7 @@ frame with the mouse." | |||
| 663 | ;; difference between `pos-x' and `snap-x' (or `pos-y' and | 663 | ;; difference between `pos-x' and `snap-x' (or `pos-y' and |
| 664 | ;; `snap-y') exceeds the value of FRAME's `snap-width' | 664 | ;; `snap-y') exceeds the value of FRAME's `snap-width' |
| 665 | ;; parameter, unsnap FRAME (at the respective side). `snap-x' | 665 | ;; parameter, unsnap FRAME (at the respective side). `snap-x' |
| 666 | ;; and `snap-y' nil mean FRAME is curerntly not snapped. | 666 | ;; and `snap-y' nil mean FRAME is currently not snapped. |
| 667 | snap-x snap-y | 667 | snap-x snap-y |
| 668 | (exitfun nil) | 668 | (exitfun nil) |
| 669 | (move | 669 | (move |
diff --git a/lisp/org/ob-J.el b/lisp/org/ob-J.el index eba4bc63498..ff4190b265d 100644 --- a/lisp/org/ob-J.el +++ b/lisp/org/ob-J.el | |||
| @@ -89,7 +89,7 @@ This function is called by `org-babel-execute-src-block'" | |||
| 89 | (org-babel-J-eval-string full-body))))) | 89 | (org-babel-J-eval-string full-body))))) |
| 90 | 90 | ||
| 91 | (defun org-babel-J-eval-string (str) | 91 | (defun org-babel-J-eval-string (str) |
| 92 | "Sends STR to the `j-console-cmd' session and exectues it." | 92 | "Sends STR to the `j-console-cmd' session and executes it." |
| 93 | (let ((session (j-console-ensure-session))) | 93 | (let ((session (j-console-ensure-session))) |
| 94 | (with-current-buffer (process-buffer session) | 94 | (with-current-buffer (process-buffer session) |
| 95 | (goto-char (point-max)) | 95 | (goto-char (point-max)) |
diff --git a/lisp/org/ob-ebnf.el b/lisp/org/ob-ebnf.el index ec5001cde81..0fceb5fc6b4 100644 --- a/lisp/org/ob-ebnf.el +++ b/lisp/org/ob-ebnf.el | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | ;;; Commentary: | 25 | ;;; Commentary: |
| 26 | 26 | ||
| 27 | ;;; Org-Babel support for using ebnf2ps to generate encapsulated postscript | 27 | ;;; Org-Babel support for using ebnf2ps to generate encapsulated postscript |
| 28 | ;;; railroad diagrams. It recogises these arguments: | 28 | ;;; railroad diagrams. It recognizes these arguments: |
| 29 | ;;; | 29 | ;;; |
| 30 | ;;; :file is required; it must include the extension '.eps.' All the rules | 30 | ;;; :file is required; it must include the extension '.eps.' All the rules |
| 31 | ;;; in the block will be drawn in the same file. This is done by | 31 | ;;; in the block will be drawn in the same file. This is done by |
| @@ -33,7 +33,7 @@ | |||
| 33 | ;;; documentation for ebnf-eps-buffer for more information). | 33 | ;;; documentation for ebnf-eps-buffer for more information). |
| 34 | ;;; | 34 | ;;; |
| 35 | ;;; :style specifies a value in ebnf-style-database. This provides the | 35 | ;;; :style specifies a value in ebnf-style-database. This provides the |
| 36 | ;;; ability to customise the output. The style can also specify the | 36 | ;;; ability to customize the output. The style can also specify the |
| 37 | ;;; grammar syntax (by setting ebnf-syntax); note that only ebnf, | 37 | ;;; grammar syntax (by setting ebnf-syntax); note that only ebnf, |
| 38 | ;;; iso-ebnf, and yacc are supported by this file. | 38 | ;;; iso-ebnf, and yacc are supported by this file. |
| 39 | 39 | ||
diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el index 2556362f926..f87d0f8e7d3 100644 --- a/lisp/org/ob-exp.el +++ b/lisp/org/ob-exp.el | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | (defcustom org-export-babel-evaluate t | 41 | (defcustom org-export-babel-evaluate t |
| 42 | "Switch controlling code evaluation during export. | 42 | "Switch controlling code evaluation during export. |
| 43 | When set to nil no code will be evaluated as part of the export | 43 | When set to nil no code will be evaluated as part of the export |
| 44 | process and no header argumentss will be obeyed. When set to | 44 | process and no header arguments will be obeyed. When set to |
| 45 | `inline-only', only inline code blocks will be executed. Users | 45 | `inline-only', only inline code blocks will be executed. Users |
| 46 | who wish to avoid evaluating code on export should use the header | 46 | who wish to avoid evaluating code on export should use the header |
| 47 | argument `:eval never-export'." | 47 | argument `:eval never-export'." |
diff --git a/lisp/org/ob-lua.el b/lisp/org/ob-lua.el index 686d41a4b68..877d895284f 100644 --- a/lisp/org/ob-lua.el +++ b/lisp/org/ob-lua.el | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | ;; for session support, lua-mode is needed. | 25 | ;; for session support, lua-mode is needed. |
| 26 | ;; lua-mode is not part of GNU Emacs/orgmode, but can be obtained | 26 | ;; lua-mode is not part of GNU Emacs/orgmode, but can be obtained |
| 27 | ;; from marmalade or melpa. | 27 | ;; from marmalade or melpa. |
| 28 | ;; The source respository is here: | 28 | ;; The source repository is here: |
| 29 | ;; https://github.com/immerrr/lua-mode | 29 | ;; https://github.com/immerrr/lua-mode |
| 30 | 30 | ||
| 31 | ;; However, sessions are not yet working. | 31 | ;; However, sessions are not yet working. |
diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el index 06477d38469..6d39e953be4 100644 --- a/lisp/org/ob-sql.el +++ b/lisp/org/ob-sql.el | |||
| @@ -105,7 +105,7 @@ Pass nil to omit that arg." | |||
| 105 | (format "%s/%s@%s:%s/%s" user password host port database)) | 105 | (format "%s/%s@%s:%s/%s" user password host port database)) |
| 106 | 106 | ||
| 107 | (defun org-babel-sql-dbstring-mssql (host user password database) | 107 | (defun org-babel-sql-dbstring-mssql (host user password database) |
| 108 | "Make sqlcmd commmand line args for database connection. | 108 | "Make sqlcmd command line args for database connection. |
| 109 | `sqlcmd' is the preferred command line tool to access Microsoft | 109 | `sqlcmd' is the preferred command line tool to access Microsoft |
| 110 | SQL Server on Windows and Linux platform." | 110 | SQL Server on Windows and Linux platform." |
| 111 | (mapconcat #'identity | 111 | (mapconcat #'identity |
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el index f8516681578..bf6a79ab855 100644 --- a/lisp/org/org-bbdb.el +++ b/lisp/org/org-bbdb.el | |||
| @@ -105,7 +105,7 @@ | |||
| 105 | (declare-function bbdb-name "ext:bbdb-com" (string elidep)) | 105 | (declare-function bbdb-name "ext:bbdb-com" (string elidep)) |
| 106 | (declare-function bbdb-completing-read-record "ext:bbdb-com" | 106 | (declare-function bbdb-completing-read-record "ext:bbdb-com" |
| 107 | (prompt &optional omit-records)) | 107 | (prompt &optional omit-records)) |
| 108 | (declare-function bbdb-record-field "ext:bbdb" (recond field)) | 108 | (declare-function bbdb-record-field "ext:bbdb" (record field)) |
| 109 | (declare-function bbdb-record-getprop "ext:bbdb" (record property)) | 109 | (declare-function bbdb-record-getprop "ext:bbdb" (record property)) |
| 110 | (declare-function bbdb-record-name "ext:bbdb" (record)) | 110 | (declare-function bbdb-record-name "ext:bbdb" (record)) |
| 111 | (declare-function bbdb-records "ext:bbdb" | 111 | (declare-function bbdb-records "ext:bbdb" |
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el index d81c9f1898e..d52b9475836 100644 --- a/lisp/org/org-bibtex.el +++ b/lisp/org/org-bibtex.el | |||
| @@ -290,8 +290,8 @@ is non-nil." | |||
| 290 | (defcustom org-bibtex-inherit-tags nil | 290 | (defcustom org-bibtex-inherit-tags nil |
| 291 | "Controls whether inherited tags are converted to bibtex keywords. | 291 | "Controls whether inherited tags are converted to bibtex keywords. |
| 292 | It is relevant only if `org-bibtex-tags-are-keywords' is non-nil. | 292 | It is relevant only if `org-bibtex-tags-are-keywords' is non-nil. |
| 293 | Tag inheritence itself is controlled by `org-use-tag-inheritence' | 293 | Tag inheritance itself is controlled by `org-use-tag-inheritance' |
| 294 | and `org-exclude-tags-from-inheritence'." | 294 | and `org-exclude-tags-from-inheritance'." |
| 295 | :group 'org-bibtex | 295 | :group 'org-bibtex |
| 296 | :version "26.1" | 296 | :version "26.1" |
| 297 | :package-version '(Org . "8.3") | 297 | :package-version '(Org . "8.3") |
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el index af03fbfe7b6..b9f23f144f7 100644 --- a/lisp/org/org-footnote.el +++ b/lisp/org/org-footnote.el | |||
| @@ -345,7 +345,7 @@ to rename." | |||
| 345 | (t nil))) | 345 | (t nil))) |
| 346 | 346 | ||
| 347 | (defun org-footnote--collect-references (&optional anonymous) | 347 | (defun org-footnote--collect-references (&optional anonymous) |
| 348 | "Collect all labelled footnote references in current buffer. | 348 | "Collect all labeled footnote references in current buffer. |
| 349 | 349 | ||
| 350 | Return an alist where associations follow the pattern | 350 | Return an alist where associations follow the pattern |
| 351 | 351 | ||
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 40a715aebd9..357fdcfa441 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el | |||
| @@ -1748,7 +1748,7 @@ function is being called interactively." | |||
| 1748 | (or compare-func | 1748 | (or compare-func |
| 1749 | (and interactive? | 1749 | (and interactive? |
| 1750 | (org-read-function | 1750 | (org-read-function |
| 1751 | (concat "Fuction for comparing keys " | 1751 | (concat "Function for comparing keys " |
| 1752 | "(empty for default `sort-subr' predicate): ") | 1752 | "(empty for default `sort-subr' predicate): ") |
| 1753 | 'allow-empty))))))) | 1753 | 'allow-empty))))))) |
| 1754 | (goto-char (point-min)) | 1754 | (goto-char (point-min)) |
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el index 146775b200f..58eb4bd4690 100644 --- a/lisp/org/org-timer.el +++ b/lisp/org/org-timer.el | |||
| @@ -143,7 +143,7 @@ the region 0:00:00." | |||
| 143 | (seconds-to-time | 143 | (seconds-to-time |
| 144 | ;; Pass `current-time' result to `float-time' (instead | 144 | ;; Pass `current-time' result to `float-time' (instead |
| 145 | ;; of calling without arguments) so that only | 145 | ;; of calling without arguments) so that only |
| 146 | ;; `current-time' has to be overriden in tests. | 146 | ;; `current-time' has to be overridden in tests. |
| 147 | (- (float-time (current-time)) delta)))) | 147 | (- (float-time (current-time)) delta)))) |
| 148 | (setq org-timer-pause-time nil) | 148 | (setq org-timer-pause-time nil) |
| 149 | (org-timer-set-mode-line 'on) | 149 | (org-timer-set-mode-line 'on) |
| @@ -172,7 +172,7 @@ With prefix arg STOP, stop it entirely." | |||
| 172 | (setq org-timer-start-time | 172 | (setq org-timer-start-time |
| 173 | ;; Pass `current-time' result to `float-time' (instead | 173 | ;; Pass `current-time' result to `float-time' (instead |
| 174 | ;; of calling without arguments) so that only | 174 | ;; of calling without arguments) so that only |
| 175 | ;; `current-time' has to be overriden in tests. | 175 | ;; `current-time' has to be overridden in tests. |
| 176 | (seconds-to-time (- (float-time (current-time)) | 176 | (seconds-to-time (- (float-time (current-time)) |
| 177 | (- pause-secs start-secs))))) | 177 | (- pause-secs start-secs))))) |
| 178 | (setq org-timer-pause-time nil) | 178 | (setq org-timer-pause-time nil) |
| @@ -235,7 +235,7 @@ it in the buffer." | |||
| 235 | (defun org-timer-seconds () | 235 | (defun org-timer-seconds () |
| 236 | ;; Pass `current-time' result to `float-time' (instead of calling | 236 | ;; Pass `current-time' result to `float-time' (instead of calling |
| 237 | ;; without arguments) so that only `current-time' has to be | 237 | ;; without arguments) so that only `current-time' has to be |
| 238 | ;; overriden in tests. | 238 | ;; overridden in tests. |
| 239 | (if org-timer-countdown-timer | 239 | (if org-timer-countdown-timer |
| 240 | (- (float-time org-timer-start-time) | 240 | (- (float-time org-timer-start-time) |
| 241 | (float-time (or org-timer-pause-time (current-time)))) | 241 | (float-time (or org-timer-pause-time (current-time)))) |
diff --git a/lisp/org/org.el b/lisp/org/org.el index 22b7dbfdaf4..5d10eed1511 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -4132,7 +4132,7 @@ PROPERTIES accepts the following attributes: | |||
| 4132 | :image-output-type string, output file type of image converter (e.g., \"png\"). | 4132 | :image-output-type string, output file type of image converter (e.g., \"png\"). |
| 4133 | :use-xcolor boolean, when non-nil, LaTeX \"xcolor\" macro is used to | 4133 | :use-xcolor boolean, when non-nil, LaTeX \"xcolor\" macro is used to |
| 4134 | deal with background and foreground color of image. | 4134 | deal with background and foreground color of image. |
| 4135 | Otherwise, dvipng style background and foregroud color | 4135 | Otherwise, dvipng style background and foreground color |
| 4136 | format are generated. You may then refer to them in | 4136 | format are generated. You may then refer to them in |
| 4137 | command options with \"%F\" and \"%B\". | 4137 | command options with \"%F\" and \"%B\". |
| 4138 | :image-size-adjust cons of numbers, the car element is used to adjust LaTeX | 4138 | :image-size-adjust cons of numbers, the car element is used to adjust LaTeX |
| @@ -17106,7 +17106,7 @@ user." | |||
| 17106 | ;; FIXME: cleanup and comment | 17106 | ;; FIXME: cleanup and comment |
| 17107 | ;; Pass `current-time' result to `decode-time' (instead of calling | 17107 | ;; Pass `current-time' result to `decode-time' (instead of calling |
| 17108 | ;; without arguments) so that only `current-time' has to be | 17108 | ;; without arguments) so that only `current-time' has to be |
| 17109 | ;; overriden in tests. | 17109 | ;; overridden in tests. |
| 17110 | (let ((org-def def) | 17110 | (let ((org-def def) |
| 17111 | (org-defdecode defdecode) | 17111 | (org-defdecode defdecode) |
| 17112 | (nowdecode (decode-time (current-time))) | 17112 | (nowdecode (decode-time (current-time))) |
| @@ -17288,7 +17288,7 @@ user." | |||
| 17288 | (unless deltadef | 17288 | (unless deltadef |
| 17289 | ;; Pass `current-time' result to `decode-time' (instead of | 17289 | ;; Pass `current-time' result to `decode-time' (instead of |
| 17290 | ;; calling without arguments) so that only `current-time' has | 17290 | ;; calling without arguments) so that only `current-time' has |
| 17291 | ;; to be overriden in tests. | 17291 | ;; to be overridden in tests. |
| 17292 | (let ((now (decode-time (current-time)))) | 17292 | (let ((now (decode-time (current-time)))) |
| 17293 | (setq day (nth 3 now) month (nth 4 now) year (nth 5 now)))) | 17293 | (setq day (nth 3 now) month (nth 4 now) year (nth 5 now)))) |
| 17294 | (cond ((member deltaw '("d" "")) (setq day (+ day deltan))) | 17294 | (cond ((member deltaw '("d" "")) (setq day (+ day deltan))) |
| @@ -17743,7 +17743,7 @@ BUFFER. | |||
| 17743 | 17743 | ||
| 17744 | Diary sexp timestamps are matched against DAYNR, when non-nil. | 17744 | Diary sexp timestamps are matched against DAYNR, when non-nil. |
| 17745 | If matching fails or DAYNR is nil, `org-diary-sexp-no-match' is | 17745 | If matching fails or DAYNR is nil, `org-diary-sexp-no-match' is |
| 17746 | signalled." | 17746 | signaled." |
| 17747 | (cond | 17747 | (cond |
| 17748 | ((string-match "\\`%%\\((.*)\\)" s) | 17748 | ((string-match "\\`%%\\((.*)\\)" s) |
| 17749 | ;; Sexp timestamp: try to match DAYNR, if available, since we're | 17749 | ;; Sexp timestamp: try to match DAYNR, if available, since we're |
diff --git a/lisp/org/ox-ascii.el b/lisp/org/ox-ascii.el index 2a129e9de78..8dc31be99d7 100644 --- a/lisp/org/ox-ascii.el +++ b/lisp/org/ox-ascii.el | |||
| @@ -916,7 +916,8 @@ as a plist." | |||
| 916 | ;; If destination is a target, make sure we can name the | 916 | ;; If destination is a target, make sure we can name the |
| 917 | ;; container it refers to. | 917 | ;; container it refers to. |
| 918 | (enumerable | 918 | (enumerable |
| 919 | (org-element-lineage datum '(headline paragrah src-block table) t))) | 919 | (org-element-lineage datum |
| 920 | '(headline paragraph src-block table) t))) | ||
| 920 | (pcase (org-element-type enumerable) | 921 | (pcase (org-element-type enumerable) |
| 921 | (`headline | 922 | (`headline |
| 922 | (format (org-ascii--translate "See section %s" info) | 923 | (format (org-ascii--translate "See section %s" info) |
| @@ -1752,7 +1753,7 @@ contextual information." | |||
| 1752 | "Transcode a SPECIAL-BLOCK element from Org to ASCII. | 1753 | "Transcode a SPECIAL-BLOCK element from Org to ASCII. |
| 1753 | CONTENTS holds the contents of the block. INFO is a plist | 1754 | CONTENTS holds the contents of the block. INFO is a plist |
| 1754 | holding contextual information." | 1755 | holding contextual information." |
| 1755 | ;; "JUSTIFYLEFT" and "JUSTFYRIGHT" have already been taken care of | 1756 | ;; "JUSTIFYLEFT" and "JUSTIFYRIGHT" have already been taken care of |
| 1756 | ;; at a lower level. There is no other special block type to | 1757 | ;; at a lower level. There is no other special block type to |
| 1757 | ;; handle. | 1758 | ;; handle. |
| 1758 | contents) | 1759 | contents) |
diff --git a/lisp/org/ox-man.el b/lisp/org/ox-man.el index 71718ab7768..d0e4976edb9 100644 --- a/lisp/org/ox-man.el +++ b/lisp/org/ox-man.el | |||
| @@ -1014,7 +1014,7 @@ information." | |||
| 1014 | 1014 | ||
| 1015 | (defun org-man-timestamp (_timestamp _contents _info) | 1015 | (defun org-man-timestamp (_timestamp _contents _info) |
| 1016 | "Transcode a TIMESTAMP object from Org to Man. | 1016 | "Transcode a TIMESTAMP object from Org to Man. |
| 1017 | ONTENTS is nil. INFO is a plist holding contextual information." | 1017 | CONTENTS is nil. INFO is a plist holding contextual information." |
| 1018 | "") | 1018 | "") |
| 1019 | 1019 | ||
| 1020 | 1020 | ||
diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el index 884d6bf6910..508209ae44b 100644 --- a/lisp/org/ox-publish.el +++ b/lisp/org/ox-publish.el | |||
| @@ -1107,7 +1107,7 @@ publishing directory." | |||
| 1107 | (defun org-publish--store-crossrefs (output _backend info) | 1107 | (defun org-publish--store-crossrefs (output _backend info) |
| 1108 | "Store cross-references for current published file. | 1108 | "Store cross-references for current published file. |
| 1109 | 1109 | ||
| 1110 | OUPUT is the produced output, as a string. BACKEND is the export | 1110 | OUTPUT is the produced output, as a string. BACKEND is the export |
| 1111 | back-end used, as a symbol. INFO is the final export state, as | 1111 | back-end used, as a symbol. INFO is the final export state, as |
| 1112 | a plist. | 1112 | a plist. |
| 1113 | 1113 | ||
diff --git a/lisp/proced.el b/lisp/proced.el index 0736ab09dc9..86d79689a49 100644 --- a/lisp/proced.el +++ b/lisp/proced.el | |||
| @@ -767,7 +767,7 @@ The time interval for updates is specified via `proced-auto-update-interval'." | |||
| 767 | (while (not (eobp)) | 767 | (while (not (eobp)) |
| 768 | (cond ((looking-at mark-re) | 768 | (cond ((looking-at mark-re) |
| 769 | (proced-insert-mark nil)) | 769 | (proced-insert-mark nil)) |
| 770 | ((looking-at " ") | 770 | ((= (following-char) ?\s) |
| 771 | (proced-insert-mark t)) | 771 | (proced-insert-mark t)) |
| 772 | (t | 772 | (t |
| 773 | (forward-line 1))))))) | 773 | (forward-line 1))))))) |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 4ea097445da..9b89681c3bf 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -1198,7 +1198,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") | |||
| 1198 | ;; This function is called exclusively as a before-change function via the | 1198 | ;; This function is called exclusively as a before-change function via the |
| 1199 | ;; variable `c-get-state-before-change-functions'. | 1199 | ;; variable `c-get-state-before-change-functions'. |
| 1200 | (c-save-buffer-state (p-limit found) | 1200 | (c-save-buffer-state (p-limit found) |
| 1201 | ;; Special consideraton for deleting \ from '\''. | 1201 | ;; Special consideration for deleting \ from '\''. |
| 1202 | (if (and (> end beg) | 1202 | (if (and (> end beg) |
| 1203 | (eq (char-before end) ?\\) | 1203 | (eq (char-before end) ?\\) |
| 1204 | (<= c-new-END end)) | 1204 | (<= c-new-END end)) |
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index b3661bfe3f1..49e072c65bd 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el | |||
| @@ -1880,8 +1880,8 @@ after indenting." | |||
| 1880 | ;; FIXME This means f90-calculate-indent gives different answers | 1880 | ;; FIXME This means f90-calculate-indent gives different answers |
| 1881 | ;; for comments and preprocessor lines to this function. | 1881 | ;; for comments and preprocessor lines to this function. |
| 1882 | ;; Better to make f90-calculate-indent return the correct answer? | 1882 | ;; Better to make f90-calculate-indent return the correct answer? |
| 1883 | (cond ((looking-at "!") (setq indent (f90-comment-indent))) | 1883 | (cond ((= (following-char) ?!) (setq indent (f90-comment-indent))) |
| 1884 | ((looking-at "#") (setq indent 0)) | 1884 | ((= (following-char) ?#) (setq indent 0)) |
| 1885 | (t | 1885 | (t |
| 1886 | (and f90-smart-end (looking-at "end") | 1886 | (and f90-smart-end (looking-at "end") |
| 1887 | (f90-match-end)) | 1887 | (f90-match-end)) |
diff --git a/lisp/ses.el b/lisp/ses.el index 97bade380ec..741d588e4be 100644 --- a/lisp/ses.el +++ b/lisp/ses.el | |||
| @@ -1880,7 +1880,7 @@ Does not execute cell formulas or print functions." | |||
| 1880 | (setq ses--numlocprn 0) | 1880 | (setq ses--numlocprn 0) |
| 1881 | (dotimes (_ numlocprn) | 1881 | (dotimes (_ numlocprn) |
| 1882 | (let ((x (read (current-buffer)))) | 1882 | (let ((x (read (current-buffer)))) |
| 1883 | (or (and (looking-at-p "\n") | 1883 | (or (and (= (following-char) ?\n) |
| 1884 | (eq (car-safe x) 'ses-local-printer) | 1884 | (eq (car-safe x) 'ses-local-printer) |
| 1885 | (apply #'ses--local-printer (cdr x))) | 1885 | (apply #'ses--local-printer (cdr x))) |
| 1886 | (error "local printer-def error")) | 1886 | (error "local printer-def error")) |
| @@ -1890,7 +1890,7 @@ Does not execute cell formulas or print functions." | |||
| 1890 | (dotimes (col ses--numcols) | 1890 | (dotimes (col ses--numcols) |
| 1891 | (let* ((x (read (current-buffer))) | 1891 | (let* ((x (read (current-buffer))) |
| 1892 | (sym (car-safe (cdr-safe x)))) | 1892 | (sym (car-safe (cdr-safe x)))) |
| 1893 | (or (and (looking-at-p "\n") | 1893 | (or (and (= (following-char) ?\n) |
| 1894 | (eq (car-safe x) 'ses-cell) | 1894 | (eq (car-safe x) 'ses-cell) |
| 1895 | (ses-create-cell-variable sym row col)) | 1895 | (ses-create-cell-variable sym row col)) |
| 1896 | (error "Cell-def error")) | 1896 | (error "Cell-def error")) |
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index f25b1a45ba1..1d453d2980e 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el | |||
| @@ -1118,7 +1118,7 @@ for this to be permanent." | |||
| 1118 | (save-excursion | 1118 | (save-excursion |
| 1119 | (goto-char (point-min)) | 1119 | (goto-char (point-min)) |
| 1120 | (while (not (eobp)) | 1120 | (while (not (eobp)) |
| 1121 | (if (looking-at "D") | 1121 | (if (= (following-char) ?D) |
| 1122 | (progn (tar-expunge-internal) | 1122 | (progn (tar-expunge-internal) |
| 1123 | (setq n (1+ n))) | 1123 | (setq n (1+ n))) |
| 1124 | (forward-line 1))) | 1124 | (forward-line 1))) |
diff --git a/lisp/window.el b/lisp/window.el index c933996a72f..43e9e995953 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -8033,7 +8033,7 @@ parameters of FRAME." | |||
| 8033 | ;; to its workarea or the parent frame's native rectangle. | 8033 | ;; to its workarea or the parent frame's native rectangle. |
| 8034 | (margins (or (frame-parameter frame 'fit-frame-to-buffer-margins) | 8034 | (margins (or (frame-parameter frame 'fit-frame-to-buffer-margins) |
| 8035 | fit-frame-to-buffer-margins)) | 8035 | fit-frame-to-buffer-margins)) |
| 8036 | ;; Convert margins intto pixel offsets from the left-top | 8036 | ;; Convert margins into pixel offsets from the left-top |
| 8037 | ;; corner of FRAME's display or parent. | 8037 | ;; corner of FRAME's display or parent. |
| 8038 | (left-margin (if (nth 0 margins) | 8038 | (left-margin (if (nth 0 margins) |
| 8039 | (window--sanitize-margin | 8039 | (window--sanitize-margin |
diff --git a/src/window.c b/src/window.c index 4816bd69909..857870591f3 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4875,7 +4875,7 @@ mark_window_cursors_off (struct window *w) | |||
| 4875 | * window_wants_mode_line: | 4875 | * window_wants_mode_line: |
| 4876 | * | 4876 | * |
| 4877 | * Return 1 if window W wants a mode line and is high enough to | 4877 | * Return 1 if window W wants a mode line and is high enough to |
| 4878 | * accomodate it, 0 otherwise. | 4878 | * accommodate it, 0 otherwise. |
| 4879 | * | 4879 | * |
| 4880 | * W wants a mode line if it's a leaf window and neither a minibuffer | 4880 | * W wants a mode line if it's a leaf window and neither a minibuffer |
| 4881 | * nor a pseudo window. Moreover, its 'window-mode-line-format' | 4881 | * nor a pseudo window. Moreover, its 'window-mode-line-format' |
| @@ -4905,14 +4905,14 @@ window_wants_mode_line (struct window *w) | |||
| 4905 | * window_wants_header_line: | 4905 | * window_wants_header_line: |
| 4906 | * | 4906 | * |
| 4907 | * Return 1 if window W wants a header line and is high enough to | 4907 | * Return 1 if window W wants a header line and is high enough to |
| 4908 | * accomodate it, 0 otherwise. | 4908 | * accommodate it, 0 otherwise. |
| 4909 | * | 4909 | * |
| 4910 | * W wants a header line if it's a leaf window and neither a minibuffer | 4910 | * W wants a header line if it's a leaf window and neither a minibuffer |
| 4911 | * nor a pseudo window. Moreover, its 'window-mode-line-format' | 4911 | * nor a pseudo window. Moreover, its 'window-mode-line-format' |
| 4912 | * parameter must not be 'none' and either that parameter or W's | 4912 | * parameter must not be 'none' and either that parameter or W's |
| 4913 | * buffer's 'mode-line-format' value must be non-nil. Finally, W must | 4913 | * buffer's 'mode-line-format' value must be non-nil. Finally, W must |
| 4914 | * be higher than its frame's canonical character height and be able to | 4914 | * be higher than its frame's canonical character height and be able to |
| 4915 | * accomodate a mode line too if necessary (the mode line prevails). | 4915 | * accommodate a mode line too if necessary (the mode line prevails). |
| 4916 | */ | 4916 | */ |
| 4917 | bool | 4917 | bool |
| 4918 | window_wants_header_line (struct window *w) | 4918 | window_wants_header_line (struct window *w) |
diff --git a/src/xdisp.c b/src/xdisp.c index 8bc5d81f448..1c316fa4932 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -16431,9 +16431,6 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16431 | eassert (XMARKER (w->start)->buffer == buffer); | 16431 | eassert (XMARKER (w->start)->buffer == buffer); |
| 16432 | eassert (XMARKER (w->pointm)->buffer == buffer); | 16432 | eassert (XMARKER (w->pointm)->buffer == buffer); |
| 16433 | 16433 | ||
| 16434 | /* We come here again if we need to run window-text-change-functions | ||
| 16435 | below. */ | ||
| 16436 | restart: | ||
| 16437 | reconsider_clip_changes (w); | 16434 | reconsider_clip_changes (w); |
| 16438 | frame_line_height = default_line_pixel_height (w); | 16435 | frame_line_height = default_line_pixel_height (w); |
| 16439 | margin = window_scroll_margin (w, MARGIN_IN_LINES); | 16436 | margin = window_scroll_margin (w, MARGIN_IN_LINES); |
| @@ -16500,16 +16497,6 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16500 | && !window_outdated (w) | 16497 | && !window_outdated (w) |
| 16501 | && !hscrolling_current_line_p (w)); | 16498 | && !hscrolling_current_line_p (w)); |
| 16502 | 16499 | ||
| 16503 | /* Run the window-text-change-functions | ||
| 16504 | if it is possible that the text on the screen has changed | ||
| 16505 | (either due to modification of the text, or any other reason). */ | ||
| 16506 | if (!current_matrix_up_to_date_p | ||
| 16507 | && !NILP (Vwindow_text_change_functions)) | ||
| 16508 | { | ||
| 16509 | safe_run_hooks (Qwindow_text_change_functions); | ||
| 16510 | goto restart; | ||
| 16511 | } | ||
| 16512 | |||
| 16513 | beg_unchanged = BEG_UNCHANGED; | 16500 | beg_unchanged = BEG_UNCHANGED; |
| 16514 | end_unchanged = END_UNCHANGED; | 16501 | end_unchanged = END_UNCHANGED; |
| 16515 | 16502 | ||
| @@ -31692,7 +31679,6 @@ They are still logged to the *Messages* buffer. */); | |||
| 31692 | DEFSYM (Qoverriding_terminal_local_map, "overriding-terminal-local-map"); | 31679 | DEFSYM (Qoverriding_terminal_local_map, "overriding-terminal-local-map"); |
| 31693 | DEFSYM (Qoverriding_local_map, "overriding-local-map"); | 31680 | DEFSYM (Qoverriding_local_map, "overriding-local-map"); |
| 31694 | DEFSYM (Qwindow_scroll_functions, "window-scroll-functions"); | 31681 | DEFSYM (Qwindow_scroll_functions, "window-scroll-functions"); |
| 31695 | DEFSYM (Qwindow_text_change_functions, "window-text-change-functions"); | ||
| 31696 | DEFSYM (Qredisplay_end_trigger_functions, "redisplay-end-trigger-functions"); | 31682 | DEFSYM (Qredisplay_end_trigger_functions, "redisplay-end-trigger-functions"); |
| 31697 | DEFSYM (Qinhibit_point_motion_hooks, "inhibit-point-motion-hooks"); | 31683 | DEFSYM (Qinhibit_point_motion_hooks, "inhibit-point-motion-hooks"); |
| 31698 | DEFSYM (Qeval, "eval"); | 31684 | DEFSYM (Qeval, "eval"); |
| @@ -32016,11 +32002,6 @@ is scrolled. It is not designed for that, and such use probably won't | |||
| 32016 | work. */); | 32002 | work. */); |
| 32017 | Vwindow_scroll_functions = Qnil; | 32003 | Vwindow_scroll_functions = Qnil; |
| 32018 | 32004 | ||
| 32019 | DEFVAR_LISP ("window-text-change-functions", | ||
| 32020 | Vwindow_text_change_functions, | ||
| 32021 | doc: /* Functions to call in redisplay when text in the window might change. */); | ||
| 32022 | Vwindow_text_change_functions = Qnil; | ||
| 32023 | |||
| 32024 | DEFVAR_LISP ("redisplay-end-trigger-functions", Vredisplay_end_trigger_functions, | 32005 | DEFVAR_LISP ("redisplay-end-trigger-functions", Vredisplay_end_trigger_functions, |
| 32025 | doc: /* Functions called when redisplay of a window reaches the end trigger. | 32006 | doc: /* Functions called when redisplay of a window reaches the end trigger. |
| 32026 | Each function is called with two arguments, the window and the end trigger value. | 32007 | Each function is called with two arguments, the window and the end trigger value. |
diff --git a/test/lisp/calendar/todo-mode-resources/todo-test-1.toda b/test/lisp/calendar/todo-mode-resources/todo-test-1.toda index 8ca4e1908da..82262bddb68 100644 --- a/test/lisp/calendar/todo-mode-resources/todo-test-1.toda +++ b/test/lisp/calendar/todo-mode-resources/todo-test-1.toda | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | (("testcat1" . [0 0 1 0]) ("testcat2" . [0 0 1 0]) ("testcat3" . [0 0 1 0])) | 1 | (("testcat1" . [0 0 1 0]) ("testcat2" . [0 0 1 0]) ("testcat33" . [0 0 1 0])) |
| 2 | --==-- testcat1 | 2 | --==-- testcat1 |
| 3 | 3 | ||
| 4 | ==--== DONE | 4 | ==--== DONE |
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | ==--== DONE | 8 | ==--== DONE |
| 9 | [DONE May 28, 2017] [May 28, 2017] testcat2 item1 | 9 | [DONE May 28, 2017] [May 28, 2017] testcat2 item1 |
| 10 | --==-- testcat3 | 10 | --==-- testcat33 |
| 11 | 11 | ||
| 12 | ==--== DONE | 12 | ==--== DONE |
| 13 | [DONE May 28, 2017] [May 28, 2017] testcat3 item1 | 13 | [DONE May 28, 2017] [May 28, 2017] testcat33 item1 |
diff --git a/test/lisp/calendar/todo-mode-resources/todo-test-1.todo b/test/lisp/calendar/todo-mode-resources/todo-test-1.todo index 8e845df6b69..598d487cad9 100644 --- a/test/lisp/calendar/todo-mode-resources/todo-test-1.todo +++ b/test/lisp/calendar/todo-mode-resources/todo-test-1.todo | |||
| @@ -1,12 +1,20 @@ | |||
| 1 | (("testcat1" . [2 0 0 1]) ("testcat2" . [1 0 0 1])) | 1 | (("testcat1" . [2 0 2 1]) ("testcat2" . [3 0 1 1]) ("testcat3" . [0 0 0 0])) |
| 2 | --==-- testcat1 | 2 | --==-- testcat1 |
| 3 | [May 29, 2017] testcat1 item3 | 3 | [May 29, 2017] testcat1 item3 |
| 4 | has more than one line | 4 | has more than one line |
| 5 | to test item highlighting | 5 | to test item highlighting |
| 6 | [May 26, 2017] testcat1 item2 | 6 | [Jul 3, 2017] testcat1 item4 |
| 7 | 7 | ||
| 8 | ==--== DONE | 8 | ==--== DONE |
| 9 | [DONE Jul 3, 2017] [Jun 30, 2017] testcat1 item5 | ||
| 10 | [DONE Jul 3, 2017] [May 30, 2017] testcat1 item2 | ||
| 9 | --==-- testcat2 | 11 | --==-- testcat2 |
| 10 | [May 28, 2017] testcat2 item2 | 12 | [Jul 3, 2017] testcat2 item3 |
| 13 | [Jul 3, 2017] testcat2 item4 | ||
| 14 | [Jul 3, 2017] testcat2 item5 | ||
| 15 | |||
| 16 | ==--== DONE | ||
| 17 | [DONE Jul 3, 2017] [May 28, 2017] testcat2 item2 | ||
| 18 | --==-- testcat3 | ||
| 11 | 19 | ||
| 12 | ==--== DONE | 20 | ==--== DONE |
diff --git a/test/lisp/calendar/todo-mode-tests.el b/test/lisp/calendar/todo-mode-tests.el index 08dfe541929..71589879205 100644 --- a/test/lisp/calendar/todo-mode-tests.el +++ b/test/lisp/calendar/todo-mode-tests.el | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | 44 | ||
| 45 | (defmacro with-todo-test (&rest body) | 45 | (defmacro with-todo-test (&rest body) |
| 46 | "Set up an isolated todo-mode test environment." | 46 | "Set up an isolated todo-mode test environment." |
| 47 | (declare (debug (body))) | ||
| 47 | `(let* ((todo-test-home (make-temp-file "todo-test-home-" t)) | 48 | `(let* ((todo-test-home (make-temp-file "todo-test-home-" t)) |
| 48 | (process-environment (cons (format "HOME=%s" todo-test-home) | 49 | (process-environment (cons (format "HOME=%s" todo-test-home) |
| 49 | process-environment)) | 50 | process-environment)) |
| @@ -52,27 +53,35 @@ | |||
| 52 | (car (funcall todo-files-function))))) | 53 | (car (funcall todo-files-function))))) |
| 53 | (unwind-protect | 54 | (unwind-protect |
| 54 | (progn ,@body) | 55 | (progn ,@body) |
| 56 | ;; Restore pre-test-run state of test files. | ||
| 57 | (dolist (f (directory-files todo-directory)) | ||
| 58 | (let ((buf (get-file-buffer f))) | ||
| 59 | (when buf | ||
| 60 | (with-current-buffer buf | ||
| 61 | (restore-buffer-modified-p nil) | ||
| 62 | (kill-buffer))))) | ||
| 55 | (delete-directory todo-test-home t)))) | 63 | (delete-directory todo-test-home t)))) |
| 56 | 64 | ||
| 57 | ;; (defun todo-test-show (num &optional archive) | 65 | (defun todo-test--show (num &optional archive) |
| 58 | ;; "Display category NUM of test todo file. | 66 | "Display category NUM of test todo file. |
| 59 | ;; With non-nil ARCHIVE argument, display test archive file category." | 67 | With non-nil ARCHIVE argument, display test archive file category." |
| 60 | ;; (let* ((file (if archive todo-test-archive-1 todo-test-file-1)) | 68 | (let* ((file (if archive todo-test-archive-1 todo-test-file-1)) |
| 61 | ;; (buf (find-file-noselect file))) | 69 | (buf (find-file-noselect file))) |
| 62 | ;; (set-buffer buf) | 70 | (set-buffer buf) |
| 63 | ;; (if archive (todo-archive-mode) (todo-mode)) | 71 | (if archive (todo-archive-mode) (todo-mode)) |
| 72 | (setq todo-category-number num) | ||
| 73 | (todo-category-select) | ||
| 74 | (goto-char (point-min)))) | ||
| 75 | |||
| 76 | ;; (defun todo-test-get-archive (num) | ||
| 77 | ;; "Display category NUM of todo archive test file." | ||
| 78 | ;; (let ((archive-buf (find-file-noselect todo-test-archive-1))) | ||
| 79 | ;; (set-buffer archive-buf) | ||
| 80 | ;; (todo-archive-mode) | ||
| 64 | ;; (setq todo-category-number num) | 81 | ;; (setq todo-category-number num) |
| 65 | ;; (todo-category-select))) | 82 | ;; (todo-category-select))) |
| 66 | 83 | ||
| 67 | (defun todo-test-get-archive (num) | 84 | (defun todo-test--is-current-buffer (filename) |
| 68 | "Display category NUM of todo archive test file." | ||
| 69 | (let ((archive-buf (find-file-noselect todo-test-archive-1))) | ||
| 70 | (set-buffer archive-buf) | ||
| 71 | (todo-archive-mode) | ||
| 72 | (setq todo-category-number num) | ||
| 73 | (todo-category-select))) | ||
| 74 | |||
| 75 | (defun todo-test-is-current-buffer (filename) | ||
| 76 | "Return non-nil if FILENAME's buffer is current." | 85 | "Return non-nil if FILENAME's buffer is current." |
| 77 | (let ((bufname (buffer-file-name (current-buffer)))) | 86 | (let ((bufname (buffer-file-name (current-buffer)))) |
| 78 | (and bufname (equal (file-truename bufname) filename)))) | 87 | (and bufname (equal (file-truename bufname) filename)))) |
| @@ -85,24 +94,24 @@ the current todo-mode category. Quitting todo-mode without an | |||
| 85 | intermediate buffer switch should not make the archive buffer | 94 | intermediate buffer switch should not make the archive buffer |
| 86 | current again." | 95 | current again." |
| 87 | (with-todo-test | 96 | (with-todo-test |
| 88 | (todo-test-get-archive 2) | 97 | (todo-test--show 2 'archive) |
| 89 | (let ((cat-name (todo-current-category))) | 98 | (let ((cat-name (todo-current-category))) |
| 90 | (todo-quit) | 99 | (todo-quit) |
| 91 | (should (todo-test-is-current-buffer todo-test-file-1)) | 100 | (should (todo-test--is-current-buffer todo-test-file-1)) |
| 92 | (should (equal (todo-current-category) cat-name)) | 101 | (should (equal (todo-current-category) cat-name)) |
| 93 | (todo-test-get-archive 1) | 102 | (todo-test--show 1 'archive) |
| 94 | (setq cat-name (todo-current-category)) | 103 | (setq cat-name (todo-current-category)) |
| 95 | (todo-quit) | 104 | (todo-quit) |
| 96 | (should (todo-test-is-current-buffer todo-test-file-1)) | 105 | (should (todo-test--is-current-buffer todo-test-file-1)) |
| 97 | (should (equal todo-category-number 1)) | 106 | (should (equal todo-category-number 1)) |
| 98 | (todo-forward-category) ; Category 2 in todo file now current. | 107 | (todo-forward-category) ; Category 2 in todo file now current. |
| 99 | (todo-test-get-archive 3) ; No corresponding category in todo file. | 108 | (todo-test--show 3 'archive) ; No corresponding category in todo file. |
| 100 | (setq cat-name (todo-current-category)) | 109 | (setq cat-name (todo-current-category)) |
| 101 | (todo-quit) | 110 | (todo-quit) |
| 102 | (should (todo-test-is-current-buffer todo-test-file-1)) | 111 | (should (todo-test--is-current-buffer todo-test-file-1)) |
| 103 | (should (equal todo-category-number 2)) | 112 | (should (equal todo-category-number 2)) |
| 104 | (todo-quit) | 113 | (todo-quit) |
| 105 | (should-not (todo-test-is-current-buffer todo-test-archive-1))))) | 114 | (should-not (todo-test--is-current-buffer todo-test-archive-1))))) |
| 106 | 115 | ||
| 107 | (ert-deftest todo-test-todo-quit02 () ; bug#27121 | 116 | (ert-deftest todo-test-todo-quit02 () ; bug#27121 |
| 108 | "Test the behavior of todo-quit with todo and non-todo buffers. | 117 | "Test the behavior of todo-quit with todo and non-todo buffers. |
| @@ -111,20 +120,19 @@ buffer is buried by quit-window, the todo-mode buffer should not | |||
| 111 | become current." | 120 | become current." |
| 112 | (with-todo-test | 121 | (with-todo-test |
| 113 | (todo-show) | 122 | (todo-show) |
| 114 | (should (todo-test-is-current-buffer todo-test-file-1)) | 123 | (should (todo-test--is-current-buffer todo-test-file-1)) |
| 115 | (let ((dir (dired default-directory))) | 124 | (let ((dir (dired default-directory))) |
| 116 | (todo-show) | 125 | (todo-show) |
| 117 | (todo-quit) | 126 | (todo-quit) |
| 118 | (should (equal (current-buffer) dir)) | 127 | (should (equal (current-buffer) dir)) |
| 119 | (quit-window) | 128 | (quit-window) |
| 120 | (should-not (todo-test-is-current-buffer todo-test-file-1))))) | 129 | (should-not (todo-test--is-current-buffer todo-test-file-1))))) |
| 121 | 130 | ||
| 122 | (ert-deftest todo-test-item-highlighting () ; bug#27133 | 131 | (ert-deftest todo-test-item-highlighting () ; bug#27133 |
| 123 | "Test whether `todo-toggle-item-highlighting' highlights whole item. | 132 | "Test whether `todo-toggle-item-highlighting' highlights whole item. |
| 124 | In particular, all lines of a multiline item should be highlighted." | 133 | In particular, all lines of a multiline item should be highlighted." |
| 125 | (with-todo-test | 134 | (with-todo-test |
| 126 | (todo-show) | 135 | (todo-test--show 1) |
| 127 | (todo-jump-to-category nil "testcat1") ; For test rerun. | ||
| 128 | (todo-toggle-item-highlighting) | 136 | (todo-toggle-item-highlighting) |
| 129 | (let ((end (1- (todo-item-end))) | 137 | (let ((end (1- (todo-item-end))) |
| 130 | (beg (todo-item-start))) | 138 | (beg (todo-item-start))) |
| @@ -134,5 +142,413 @@ In particular, all lines of a multiline item should be highlighted." | |||
| 134 | (should (eq (next-single-char-property-change beg 'face) (1+ end)))) | 142 | (should (eq (next-single-char-property-change beg 'face) (1+ end)))) |
| 135 | (todo-toggle-item-highlighting))) ; Turn off highlighting (for test rerun). | 143 | (todo-toggle-item-highlighting))) ; Turn off highlighting (for test rerun). |
| 136 | 144 | ||
| 145 | (ert-deftest todo-test-revert-buffer01 () ; bug#27609 | ||
| 146 | "Test whether todo-mode buffer remains read-only after reverting." | ||
| 147 | (with-todo-test | ||
| 148 | (todo-show) | ||
| 149 | (let ((opoint (point))) | ||
| 150 | (should (equal buffer-read-only t)) | ||
| 151 | (todo-revert-buffer nil t) | ||
| 152 | (should (equal buffer-read-only t)) | ||
| 153 | (should (eq (point) opoint))))) | ||
| 154 | |||
| 155 | (ert-deftest todo-test-revert-buffer02 () ; bug#27609 | ||
| 156 | "Test whether todo-archive-mode buffer remains read-only after reverting." | ||
| 157 | (with-todo-test | ||
| 158 | (todo-test--show 1 'archive) | ||
| 159 | (let ((opoint (point))) | ||
| 160 | (should (equal buffer-read-only t)) | ||
| 161 | (todo-revert-buffer nil t) | ||
| 162 | (should (equal buffer-read-only t)) | ||
| 163 | (should (eq (point) opoint))))) | ||
| 164 | |||
| 165 | (ert-deftest todo-test-raise-lower-priority () | ||
| 166 | "Test the behavior of todo-{raise,lower}-item-priority." | ||
| 167 | (with-todo-test | ||
| 168 | ;; (todo-show) | ||
| 169 | (todo-test--show 1) | ||
| 170 | (goto-char (point-min)) | ||
| 171 | (let ((p1 (point)) | ||
| 172 | (s1 (todo-item-string)) | ||
| 173 | p2 s2 p3) | ||
| 174 | ;; First item in category. | ||
| 175 | (should (equal p1 (todo-item-start))) | ||
| 176 | (todo-next-item) | ||
| 177 | (setq p2 (point)) | ||
| 178 | ;; Second item in category. | ||
| 179 | (setq s2 (todo-item-string)) | ||
| 180 | ;; Second item is lower. | ||
| 181 | (should (> p2 p1)) | ||
| 182 | ;; Case 1: lowering priority. | ||
| 183 | (todo-previous-item) | ||
| 184 | (todo-lower-item-priority) | ||
| 185 | ;; Now what was the first item is the second and vice versa. | ||
| 186 | (setq p1 (point)) | ||
| 187 | (should (equal s1 (todo-item-string))) | ||
| 188 | (todo-previous-item) | ||
| 189 | (setq p2 (point)) | ||
| 190 | (should (equal s2 (todo-item-string))) | ||
| 191 | (should (> p1 p2)) | ||
| 192 | ;; Case 2: raising priority. | ||
| 193 | (todo-next-item) | ||
| 194 | (todo-raise-item-priority) | ||
| 195 | ;; Now what had become the second item is again the first and | ||
| 196 | ;; vice versa. | ||
| 197 | (setq p1 (point)) | ||
| 198 | (should (equal s1 (todo-item-string))) | ||
| 199 | (todo-next-item) | ||
| 200 | (setq p2 (point)) | ||
| 201 | (should (equal s2 (todo-item-string))) | ||
| 202 | (should (> p2 p1)) | ||
| 203 | ;; Case 3: empty line (bug#27609). | ||
| 204 | (goto-char (point-max)) | ||
| 205 | ;; The last line in the category is always empty. | ||
| 206 | (should-not (todo-item-string)) | ||
| 207 | (todo-raise-item-priority) | ||
| 208 | ;; Raising item priority on the empty string is a noop. | ||
| 209 | (should (equal (point) (point-max))) | ||
| 210 | (todo-lower-item-priority) | ||
| 211 | ;; Lowering item priority on the empty string is a noop. | ||
| 212 | (should (equal (point) (point-max))) | ||
| 213 | ;; Case 4: done item (bug#27609). | ||
| 214 | ;; todo-toggle-view-done-items recenters the window if point is | ||
| 215 | ;; not visible, so we have to make sure the todo-mode buffer is | ||
| 216 | ;; in a live window in the test run to avoid failing with (error | ||
| 217 | ;; "`recenter'ing a window that does not display ;; current-buffer."). | ||
| 218 | ;; (But this is not necessary in todo-test-toggle-item-header01 | ||
| 219 | ;; below -- why not, or why is it here? Note that without | ||
| 220 | ;; setting window buffer, the test only fails on the first run -- | ||
| 221 | ;; on rerunning it passes.) | ||
| 222 | (set-window-buffer nil (current-buffer)) | ||
| 223 | (todo-toggle-view-done-items) | ||
| 224 | (todo-next-item) | ||
| 225 | ;; Now the current item is the first done item. | ||
| 226 | (should (todo-done-item-p)) | ||
| 227 | (setq p3 (point)) | ||
| 228 | (todo-raise-item-priority) | ||
| 229 | ;; Raising item priority on a done item is a noop. | ||
| 230 | (should (eq (point) p3)) | ||
| 231 | (todo-lower-item-priority) | ||
| 232 | ;; Lowering item priority on a done item is a noop. | ||
| 233 | (should (eq (point) p3))))) | ||
| 234 | |||
| 235 | (ert-deftest todo-test-todo-mark-unmark-category () ; bug#27609 | ||
| 236 | "Test behavior of todo-mark-category and todo-unmark-category." | ||
| 237 | (with-todo-test | ||
| 238 | (todo-show) | ||
| 239 | (let ((cat (todo-current-category))) | ||
| 240 | (todo-mark-category) | ||
| 241 | (should (equal (todo-get-count 'todo cat) | ||
| 242 | (cdr (assoc cat todo-categories-with-marks)))) | ||
| 243 | (todo-unmark-category) | ||
| 244 | (should-not (assoc cat todo-categories-with-marks))))) | ||
| 245 | |||
| 246 | (defun todo-test--move-item (cat &optional priority file) | ||
| 247 | "Move item(s) to category CAT with priority PRIORITY (for todo item). | ||
| 248 | This provides a noninteractive API for todo-move-item for use in | ||
| 249 | automatic testing." | ||
| 250 | (let ((cat0 (car (nth (1- cat) todo-categories))) | ||
| 251 | (file0 (or file todo-current-todo-file))) | ||
| 252 | (cl-letf (((symbol-function 'todo-read-category) | ||
| 253 | (lambda (_prompt &optional _match-type _file) (cons cat0 file0))) | ||
| 254 | ((symbol-function 'read-number) ; For todo-set-item-priority | ||
| 255 | (lambda (_prompt &optional _default) (or priority 1)))) | ||
| 256 | (todo-move-item)))) | ||
| 257 | |||
| 258 | (ert-deftest todo-test-move-item01 () | ||
| 259 | "Test moving a todo item to another category with a given priority." | ||
| 260 | (with-todo-test | ||
| 261 | (todo-test--show 1) | ||
| 262 | (let* ((cat1 (todo-current-category)) | ||
| 263 | (cat2 (car (nth 1 todo-categories))) | ||
| 264 | (cat1-todo (todo-get-count 'todo cat1)) | ||
| 265 | (cat2-todo (todo-get-count 'todo cat2)) | ||
| 266 | (item (todo-item-string))) | ||
| 267 | (todo-test--move-item 2 3) | ||
| 268 | (should (equal (todo-current-category) cat2)) | ||
| 269 | (should (equal (todo-item-string) item)) | ||
| 270 | (should (equal (overlay-get (todo-get-overlay 'prefix) 'before-string) | ||
| 271 | "3 ")) | ||
| 272 | (todo-backward-category) ; Go to first category again. | ||
| 273 | (should-error (search-forward item)) | ||
| 274 | (should (= (todo-get-count 'todo cat1) (1- cat1-todo))) | ||
| 275 | (should (= (todo-get-count 'todo cat2) (1+ cat2-todo)))))) | ||
| 276 | |||
| 277 | (ert-deftest todo-test-move-item02 () ; bug#27609 | ||
| 278 | "Test moving a marked todo item to previous category." | ||
| 279 | (with-todo-test | ||
| 280 | (todo-test--show 2) | ||
| 281 | (let* ((cat2 (todo-current-category)) | ||
| 282 | (cat1 (car (nth 0 todo-categories))) | ||
| 283 | (cat2-todo (todo-get-count 'todo cat2)) | ||
| 284 | (cat1-todo (todo-get-count 'todo cat1)) | ||
| 285 | (item (todo-item-string))) | ||
| 286 | ;; If todo-toggle-mark-item is not called interactively, its | ||
| 287 | ;; optional prefix argument evaluates to nil and this raises a | ||
| 288 | ;; wrong-type-argument error. | ||
| 289 | (call-interactively 'todo-toggle-mark-item) | ||
| 290 | (todo-test--move-item 1) | ||
| 291 | (should (equal (todo-current-category) cat1)) | ||
| 292 | (should (equal (todo-item-string) item)) | ||
| 293 | (should (equal (overlay-get (todo-get-overlay 'prefix) 'before-string) | ||
| 294 | "1 ")) | ||
| 295 | (todo-forward-category) ; Go to second category again. | ||
| 296 | (should-error (search-forward item)) | ||
| 297 | (should (= (todo-get-count 'todo cat1) (1+ cat1-todo))) | ||
| 298 | (should (= (todo-get-count 'todo cat2) (1- cat2-todo)))))) | ||
| 299 | |||
| 300 | (ert-deftest todo-test-move-item03 () ; bug#27609 | ||
| 301 | "Test moving a done item to another category. | ||
| 302 | In the new category it should be the first done item." | ||
| 303 | (with-todo-test | ||
| 304 | (todo-test--show 1) | ||
| 305 | (let* ((cat1 (todo-current-category)) | ||
| 306 | (cat2 (car (nth 1 todo-categories))) | ||
| 307 | (cat1-done (todo-get-count 'done cat1)) | ||
| 308 | (cat2-done (todo-get-count 'done cat2))) | ||
| 309 | (goto-char (point-max)) | ||
| 310 | (set-window-buffer nil (current-buffer)) ; Why is this necessary? | ||
| 311 | (todo-toggle-view-done-items) | ||
| 312 | (todo-next-item) | ||
| 313 | (let ((item (todo-item-string))) | ||
| 314 | (todo-test--move-item 2) | ||
| 315 | (should (equal (todo-current-category) cat2)) | ||
| 316 | (should (equal (todo-item-string) item)) | ||
| 317 | (should (todo-done-item-p)) | ||
| 318 | (forward-line -1) | ||
| 319 | (should (looking-at todo-category-done)) | ||
| 320 | (todo-backward-category) | ||
| 321 | (should-error (search-forward item)) | ||
| 322 | (should (= (todo-get-count 'done cat1) (1- cat1-done))) | ||
| 323 | (should (= (todo-get-count 'done cat2) (1+ cat2-done))))))) | ||
| 324 | |||
| 325 | (ert-deftest todo-test-move-item04 () ; bug#27609 | ||
| 326 | "Test moving both a todo and a done item to another category. | ||
| 327 | In the new category the todo item should have the provided | ||
| 328 | priority and the done item should be the first done item." | ||
| 329 | (with-todo-test | ||
| 330 | (todo-test--show 1) | ||
| 331 | (let* ((cat1 (todo-current-category)) | ||
| 332 | (cat2 (car (nth 1 todo-categories))) | ||
| 333 | (cat1-todo (todo-get-count 'todo cat1)) | ||
| 334 | (cat2-todo (todo-get-count 'todo cat2)) | ||
| 335 | (cat1-done (todo-get-count 'done cat1)) | ||
| 336 | (cat2-done (todo-get-count 'done cat2)) | ||
| 337 | (todo-item (todo-item-string))) | ||
| 338 | (call-interactively 'todo-toggle-mark-item) | ||
| 339 | (goto-char (point-max)) | ||
| 340 | ;; Why is this necessary here but not below? | ||
| 341 | (set-window-buffer nil (current-buffer)) | ||
| 342 | (todo-toggle-view-done-items) | ||
| 343 | (todo-next-item) | ||
| 344 | (let ((done-item (todo-item-string))) | ||
| 345 | (call-interactively 'todo-toggle-mark-item) | ||
| 346 | (todo-test--move-item 2 3) | ||
| 347 | (should (equal (todo-current-category) cat2)) | ||
| 348 | ;; Point should be on the moved todo item. | ||
| 349 | (should (equal (todo-item-string) todo-item)) | ||
| 350 | ;; Done items section should be visible and the move done item | ||
| 351 | ;; should be at the top of it. | ||
| 352 | (should (search-forward done-item)) | ||
| 353 | (should (todo-done-item-p)) | ||
| 354 | (forward-line -1) | ||
| 355 | (should (looking-at todo-category-done)) | ||
| 356 | ;; Make sure marked items are no longer in first category. | ||
| 357 | (todo-backward-category) | ||
| 358 | (should-error (search-forward todo-item)) | ||
| 359 | (todo-toggle-view-done-items) | ||
| 360 | (should-error (search-forward done-item)) | ||
| 361 | (should (= (todo-get-count 'todo cat1) (1- cat1-todo))) | ||
| 362 | (should (= (todo-get-count 'todo cat2) (1+ cat2-todo))) | ||
| 363 | (should (= (todo-get-count 'done cat1) (1- cat1-done))) | ||
| 364 | (should (= (todo-get-count 'done cat2) (1+ cat2-done))))))) | ||
| 365 | |||
| 366 | (ert-deftest todo-test-move-item05 () ; bug#27609 | ||
| 367 | "Test moving multiple todo and done items to another category. | ||
| 368 | Both types of item should be moved en bloc to the new category, | ||
| 369 | and the the top todo item should have the provided priority and | ||
| 370 | the top done item should be the first done item." | ||
| 371 | (with-todo-test | ||
| 372 | (todo-test--show 1) | ||
| 373 | (let* ((cat1 (todo-current-category)) | ||
| 374 | (cat2 (car (nth 1 todo-categories))) | ||
| 375 | (cat1-todo (todo-get-count 'todo cat1)) | ||
| 376 | (cat2-todo (todo-get-count 'todo cat2)) | ||
| 377 | (cat1-done (todo-get-count 'done cat1)) | ||
| 378 | (cat2-done (todo-get-count 'done cat2)) | ||
| 379 | (todo-items (buffer-string)) | ||
| 380 | (done-items (prog2 (todo-toggle-view-done-only) | ||
| 381 | (buffer-string) | ||
| 382 | (todo-toggle-view-done-only)))) | ||
| 383 | ;; Why is this necessary here but not below? | ||
| 384 | (set-window-buffer nil (current-buffer)) | ||
| 385 | (todo-toggle-view-done-items) | ||
| 386 | (todo-mark-category) | ||
| 387 | (todo-test--move-item 2 3) | ||
| 388 | (should (equal (todo-current-category) cat2)) | ||
| 389 | ;; Point should be at the start of the first moved todo item. | ||
| 390 | (should (looking-at (regexp-quote todo-items))) | ||
| 391 | ;; Done items section should be visible and the move done item | ||
| 392 | ;; should be at the top of it. | ||
| 393 | (should (search-forward done-items)) | ||
| 394 | (goto-char (match-beginning 0)) | ||
| 395 | (should (todo-done-item-p)) | ||
| 396 | (forward-line -1) | ||
| 397 | (should (looking-at todo-category-done)) | ||
| 398 | ;; Make sure marked items are no longer in first category. | ||
| 399 | (todo-backward-category) | ||
| 400 | (should (eq (point-min) (point-max))) ; All todo items were moved. | ||
| 401 | ;; This passes when run interactively but fails in a batch run: | ||
| 402 | ;; the message is displayed but (current-message) evaluates to | ||
| 403 | ;; nil. | ||
| 404 | ;; (todo-toggle-view-done-items) ; All done items were moved. | ||
| 405 | ;; (let ((msg (current-message))) | ||
| 406 | ;; (should (equal msg "There are no done items in this category."))) | ||
| 407 | (todo-toggle-view-done-only) | ||
| 408 | (should (eq (point-min) (point-max))) ; All done items were moved. | ||
| 409 | (should (= (todo-get-count 'todo cat1) 0)) | ||
| 410 | (should (= (todo-get-count 'todo cat2) (+ cat1-todo cat2-todo))) | ||
| 411 | (should (= (todo-get-count 'done cat1) 0)) | ||
| 412 | (should (= (todo-get-count 'done cat2) (+ cat1-done cat2-done)))))) | ||
| 413 | |||
| 414 | (ert-deftest todo-test-toggle-item-header01 () ; bug#27609 | ||
| 415 | "Test toggling item header from an empty category." | ||
| 416 | (with-todo-test | ||
| 417 | (todo-test--show 3) | ||
| 418 | (should (eq (point-min) (point-max))) ; Category is empty. | ||
| 419 | (todo-toggle-item-header) | ||
| 420 | (todo-backward-category) | ||
| 421 | ;; Header is hidden. | ||
| 422 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) "")) | ||
| 423 | (todo-forward-category) | ||
| 424 | (todo-toggle-item-header) | ||
| 425 | (todo-backward-category) | ||
| 426 | ;; Header is shown. | ||
| 427 | (should-not (todo-get-overlay 'header)))) | ||
| 428 | |||
| 429 | (ert-deftest todo-test-toggle-item-header02 () ; bug#27609 | ||
| 430 | "Test navigating between items with hidden header." | ||
| 431 | :expected-result :failed ; FIXME | ||
| 432 | (with-todo-test | ||
| 433 | (todo-test--show 2) | ||
| 434 | (let* ((start0 (point)) | ||
| 435 | (find-start (lambda () | ||
| 436 | (re-search-forward | ||
| 437 | (concat todo-date-string-start | ||
| 438 | todo-date-pattern | ||
| 439 | "\\( " diary-time-regexp "\\)?" | ||
| 440 | (regexp-quote todo-nondiary-end) "?") | ||
| 441 | (line-end-position) t) | ||
| 442 | (forward-char) | ||
| 443 | (point))) | ||
| 444 | (start1 (save-excursion (funcall find-start))) | ||
| 445 | (start2 (save-excursion (todo-next-item) (funcall find-start)))) | ||
| 446 | (should (looking-at todo-item-start)) | ||
| 447 | (todo-toggle-item-header) | ||
| 448 | ;; Point hasn't changed... | ||
| 449 | (should (eq (point) start0)) | ||
| 450 | (should (looking-at todo-item-start)) | ||
| 451 | ;; FIXME: In the test run this puts point at todo-item-start, | ||
| 452 | ;; i.e. the display overlay doesn't affect this movement, unlike | ||
| 453 | ;; with the command in todo-mode (and using call-interactively | ||
| 454 | ;; here doesn't change this). | ||
| 455 | (todo-next-item) | ||
| 456 | (should (eq (point) start2)) | ||
| 457 | (should-not (looking-at todo-item-start)) | ||
| 458 | (todo-previous-item) | ||
| 459 | ;; ...but now it has. | ||
| 460 | (should (eq (point) start1)) | ||
| 461 | (should-not (looking-at todo-item-start)) | ||
| 462 | ;; This is the status quo but is it desirable? | ||
| 463 | (todo-toggle-item-header) | ||
| 464 | (should (eq (point) start1)) | ||
| 465 | (should-not (looking-at todo-item-start))))) | ||
| 466 | |||
| 467 | (ert-deftest todo-test-toggle-item-header03 () ; bug#27609 | ||
| 468 | "Test display of hidden item header when changing item's priority." | ||
| 469 | (with-todo-test | ||
| 470 | (todo-test--show 2) | ||
| 471 | (todo-toggle-item-header) | ||
| 472 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) "")) | ||
| 473 | (todo-lower-item-priority) | ||
| 474 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) "")) | ||
| 475 | (todo-raise-item-priority) | ||
| 476 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) "")) | ||
| 477 | ;; Set priority noninteractively. | ||
| 478 | (cl-letf (((symbol-function 'read-number) | ||
| 479 | (lambda (_prompt &optional _default) 3))) | ||
| 480 | (todo-item-undone)) | ||
| 481 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) "")))) | ||
| 482 | |||
| 483 | (ert-deftest todo-test-toggle-item-header04 () ; bug#27609 | ||
| 484 | "Test display of hidden item header under todo-item-(un)done." | ||
| 485 | (with-todo-test | ||
| 486 | (todo-test--show 1) | ||
| 487 | (let ((item (todo-item-string))) | ||
| 488 | (todo-toggle-item-header) | ||
| 489 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) "")) | ||
| 490 | (todo-item-done) | ||
| 491 | ;; Without set-window-buffer here this test passes when run | ||
| 492 | ;; interactively but fails in a batch run. | ||
| 493 | (set-window-buffer nil (current-buffer)) | ||
| 494 | (todo-toggle-view-done-items) | ||
| 495 | (should (search-forward item)) | ||
| 496 | (todo-item-start) | ||
| 497 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) "")) | ||
| 498 | ;; Set priority for todo-item-undone noninteractively. | ||
| 499 | (cl-letf (((symbol-function 'read-number) | ||
| 500 | (lambda (_prompt &optional _default) 1))) | ||
| 501 | (todo-item-undone)) | ||
| 502 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) ""))))) | ||
| 503 | |||
| 504 | (ert-deftest todo-test-toggle-item-header05 () ; bug#27609 | ||
| 505 | "Test display of hidden item header under todo-move-item." | ||
| 506 | (with-todo-test | ||
| 507 | (todo-test--show 1) | ||
| 508 | (todo-toggle-item-header) | ||
| 509 | (todo-test--move-item 2 3) | ||
| 510 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) "")))) | ||
| 511 | |||
| 512 | (ert-deftest todo-test-toggle-item-header06 () ; bug#27609 | ||
| 513 | "Test display of hidden item header under (un)archiving. | ||
| 514 | The relocated item's header should take on the display status of | ||
| 515 | headers in the goal file, even when the display status in the | ||
| 516 | source file is different." | ||
| 517 | (with-todo-test | ||
| 518 | (todo-test--show 1) | ||
| 519 | (todo-toggle-item-header) | ||
| 520 | (todo-toggle-view-done-only) ; Go to first (i.e. top) done item. | ||
| 521 | (let ((item (todo-item-string))) | ||
| 522 | (todo-archive-done-item) | ||
| 523 | (todo-toggle-view-done-only) ; To display all items on unarchiving. | ||
| 524 | (todo-find-archive) | ||
| 525 | (should (equal (todo-item-string) item)) ; The just archived item. | ||
| 526 | ;; The archive file headers are displayed by default. | ||
| 527 | (should-not (todo-get-overlay 'header)) | ||
| 528 | (todo-unarchive-items) | ||
| 529 | ;; Headers in the todo file are still hidden. | ||
| 530 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) ""))))) | ||
| 531 | |||
| 532 | (defun todo-test--insert-item (item &optional priority) | ||
| 533 | "Insert string ITEM into current category with priority PRIORITY. | ||
| 534 | Use defaults for all other item insertion parameters. This | ||
| 535 | provides a noninteractive API for todo-insert-item for use in | ||
| 536 | automatic testing." | ||
| 537 | (cl-letf (((symbol-function 'read-from-minibuffer) | ||
| 538 | (lambda (_prompt) item)) | ||
| 539 | ((symbol-function 'read-number) ; For todo-set-item-priority | ||
| 540 | (lambda (_prompt &optional _default) (or priority 1)))) | ||
| 541 | (todo-insert-item--basic))) | ||
| 542 | |||
| 543 | (ert-deftest todo-test-toggle-item-header07 () ; bug#27609 | ||
| 544 | "Test display of hidden item header under todo-insert-item." | ||
| 545 | (with-todo-test | ||
| 546 | (todo-test--show 1) | ||
| 547 | (todo-toggle-item-header) | ||
| 548 | (let ((item "Test display of hidden item header under todo-insert-item.")) | ||
| 549 | (todo-test--insert-item item 1) | ||
| 550 | (should (equal (overlay-get (todo-get-overlay 'header) 'display) ""))))) | ||
| 551 | |||
| 552 | |||
| 137 | (provide 'todo-mode-tests) | 553 | (provide 'todo-mode-tests) |
| 138 | ;;; todo-mode-tests.el ends here | 554 | ;;; todo-mode-tests.el ends here |
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index 582041cfc2d..cc196beea23 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el | |||
| @@ -198,6 +198,32 @@ Expected initialization file: `%s'\" | |||
| 198 | (indent-region (point-min) (point-max)) | 198 | (indent-region (point-min) (point-max)) |
| 199 | (should (equal (buffer-string) correct))))) | 199 | (should (equal (buffer-string) correct))))) |
| 200 | 200 | ||
| 201 | (ert-deftest lisp-comment-indent-1 () | ||
| 202 | (with-temp-buffer | ||
| 203 | (insert "\ | ||
| 204 | \(let ( ;sf | ||
| 205 | (x 3)) | ||
| 206 | 4)") | ||
| 207 | (let ((indent-tabs-mode nil) | ||
| 208 | (correct (buffer-string))) | ||
| 209 | (emacs-lisp-mode) | ||
| 210 | (goto-char (point-min)) | ||
| 211 | (comment-indent) | ||
| 212 | (should (equal (buffer-string) correct))))) | ||
| 213 | |||
| 214 | (ert-deftest lisp-comment-indent-2 () | ||
| 215 | (with-temp-buffer | ||
| 216 | (insert "\ | ||
| 217 | \(let (;;sf | ||
| 218 | (x 3)) | ||
| 219 | 4)") | ||
| 220 | (let ((indent-tabs-mode nil) | ||
| 221 | (correct (buffer-string))) | ||
| 222 | (emacs-lisp-mode) | ||
| 223 | (goto-char (point-min)) | ||
| 224 | (comment-indent) | ||
| 225 | (should (equal (buffer-string) correct))))) | ||
| 226 | |||
| 201 | 227 | ||
| 202 | (provide 'lisp-mode-tests) | 228 | (provide 'lisp-mode-tests) |
| 203 | ;;; lisp-mode-tests.el ends here | 229 | ;;; lisp-mode-tests.el ends here |
diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el index 9dd093e7927..36db4788011 100644 --- a/test/lisp/epg-tests.el +++ b/test/lisp/epg-tests.el | |||
| @@ -30,17 +30,8 @@ | |||
| 30 | (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY")) | 30 | (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY")) |
| 31 | "Directory containing epg test data.") | 31 | "Directory containing epg test data.") |
| 32 | 32 | ||
| 33 | (defconst epg-tests-program-alist-for-passphrase-callback | 33 | (defun epg-tests-find-usable-gpg-configuration (&optional _require-passphrase) |
| 34 | '((OpenPGP | 34 | (epg-find-configuration 'OpenPGP 'no-cache)) |
| 35 | nil | ||
| 36 | ("gpg" . "1.4.3")))) | ||
| 37 | |||
| 38 | (defun epg-tests-find-usable-gpg-configuration (&optional require-passphrase) | ||
| 39 | (epg-find-configuration | ||
| 40 | 'OpenPGP | ||
| 41 | 'no-cache | ||
| 42 | (if require-passphrase | ||
| 43 | epg-tests-program-alist-for-passphrase-callback))) | ||
| 44 | 35 | ||
| 45 | (defun epg-tests-passphrase-callback (_c _k _d) | 36 | (defun epg-tests-passphrase-callback (_c _k _d) |
| 46 | ;; Need to create a copy here, since the string will be wiped out | 37 | ;; Need to create a copy here, since the string will be wiped out |
diff --git a/test/manual/etags/tex-src/gzip.texi b/test/manual/etags/tex-src/gzip.texi index 07be37187d7..ea5f7f5879e 100644 --- a/test/manual/etags/tex-src/gzip.texi +++ b/test/manual/etags/tex-src/gzip.texi | |||
| @@ -240,7 +240,7 @@ Force compression or decompression even if the file has multiple links | |||
| 240 | or the corresponding file already exists, or if the compressed data | 240 | or the corresponding file already exists, or if the compressed data |
| 241 | is read from or written to a terminal. If the input data is not in | 241 | is read from or written to a terminal. If the input data is not in |
| 242 | a format recognized by @code{gzip}, and if the option --stdout is also | 242 | a format recognized by @code{gzip}, and if the option --stdout is also |
| 243 | given, copy the input data without change to the standard ouput: let | 243 | given, copy the input data without change to the standard output: let |
| 244 | @code{zcat} behave as @code{cat}. If @samp{-f} is not given, and | 244 | @code{zcat} behave as @code{cat}. If @samp{-f} is not given, and |
| 245 | when not running in the background, @code{gzip} prompts to verify | 245 | when not running in the background, @code{gzip} prompts to verify |
| 246 | whether an existing file should be overwritten. | 246 | whether an existing file should be overwritten. |