aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPaul Eggert2014-05-04 12:37:56 -0700
committerPaul Eggert2014-05-04 12:37:56 -0700
commit3e9fa60a5c99568817a12a1011b0e61cce5d3a67 (patch)
tree831a801351db662f324d0709bf1fee718eda63e9 /lisp
parentbbdcf64f499636ba9567e8fed8f209e06380352c (diff)
parent61febcb6e32860575316b8a539a2e9f13f70e3c2 (diff)
downloademacs-3e9fa60a5c99568817a12a1011b0e61cce5d3a67.tar.gz
emacs-3e9fa60a5c99568817a12a1011b0e61cce5d3a67.zip
Merge from emacs-24; up to 2014-05-04T21:18:30Z!eggert@cs.ucla.edu
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog94
-rw-r--r--lisp/allout-widgets.el4
-rw-r--r--lisp/calendar/todo-mode.el835
-rw-r--r--lisp/cedet/ChangeLog8
-rw-r--r--lisp/cedet/ede.el4
-rw-r--r--lisp/cedet/semantic/bovine/c.el2
-rw-r--r--lisp/cedet/semantic/ia-sb.el5
-rw-r--r--lisp/cedet/semantic/tag.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el2
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/gnus/gnus-registry.el6
-rw-r--r--lisp/mail/rmailsum.el4
-rw-r--r--lisp/menu-bar.el2
-rw-r--r--lisp/minibuffer.el2
-rw-r--r--lisp/mpc.el11
-rw-r--r--lisp/progmodes/gdb-mi.el4
-rw-r--r--lisp/progmodes/js.el6
-rw-r--r--lisp/progmodes/prolog.el2
-rw-r--r--lisp/progmodes/sh-script.el2
-rw-r--r--lisp/progmodes/verilog-mode.el2
-rw-r--r--lisp/textmodes/reftex-parse.el2
-rw-r--r--lisp/url/ChangeLog4
-rw-r--r--lisp/url/url-parse.el2
-rw-r--r--lisp/vc/ediff-diff.el5
-rw-r--r--lisp/vc/ediff-init.el2
-rw-r--r--lisp/vc/ediff-util.el6
26 files changed, 506 insertions, 516 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 051d0e669b4..c0032864b66 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,97 @@
12014-05-04 Eli Zaretskii <eliz@gnu.org>
2
3 * mail/rmailsum.el (rmail-new-summary-1): Fix a typo in a comment.
4
52014-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * vc/ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer):
8 Use nil rather than `default' for the "default" appearance (bug#17388).
9 * vc/ediff-util.el (ediff-inferior-compare-regions)
10 (ediff-toggle-autorefine, ediff-unselect-difference): Don't use
11 a misleading `default' value when it's really a boolean.
12 * vc/ediff-init.el (ediff-set-overlay-face): Don't set help-echo if the
13 overlay is not visible.
14
152014-05-04 Stephen Berman <stephen.berman@gmx.net>
16
17 * calendar/todo-mode.el (todo-edit-file): Use display-warning.
18 (todo-menu): Uncomment and update.
19
202014-05-04 Stephen Berman <stephen.berman@gmx.net>
21
22 * calendar/todo-mode.el: Reimplement item editing to have the same
23 basic user interface as item insertion, and make small UI and
24 larger internal improvements to the latter.
25 (todo-insert-item): Add reference to the Todo mode user manual to
26 the documentation string.
27 (todo-insert-item--basic): Rename from todo-basic-insert-item and
28 adjust all callers. Change signature to combine diary and
29 nonmarking arguments. Incorporate functionality of deleted item
30 copying command and add error checking. Remove detailed
31 descriptions of the arguments from the documentation string, since
32 this is treated in the Todo mode user manual.
33 (todo-copy-item, todo-edit-multiline-item)
34 (todo-edit-done-item-comment, todo-edit-item-header)
35 (todo-edit-item-time, todo-edit-item-date-from-calendar)
36 (todo-edit-item-date-to-today, todo-edit-item-date-day-name)
37 (todo-edit-item-date-year, todo-edit-item-date-month)
38 (todo-edit-item-date-day, todo-edit-item-diary-nonmarking):
39 Remove.
40 (todo-edit-item): Reimplement as wrapper command for
41 todo-edit-item--next-key and make it distinguish done and not done
42 todo items.
43 (todo-edit-item--text): New function, replacing old command
44 todo-edit-item and incorporating deleted commands
45 todo-edit-multiline-item and todo-edit-done-item-comment.
46 (todo-edit-item--header): Rename from todo-basic-edit-item-header.
47 Use only numeric value of prefix argument. Remove detailed
48 descriptions of the arguments from the documentation string, since
49 this is treated in the Todo mode user manual.
50 (todo-edit-item--diary-inclusion): New function, replacing old
51 command todo-edit-item-diary-inclusion and incorporating and fixing
52 functionality of deleted command todo-edit-item-diary-nonmarking,
53 making sure to remove todo-nondiary-marker when adding
54 diary-nonmarking-symbol.
55 (todo-edit-category-diary-inclusion): Make sure to delete
56 diary-nonmarking-symbol when adding todo-nondiary-marker.
57 (todo-edit-category-diary-nonmarking): Fix indentation.
58 (todo-insert-item--parameters): Group diary and nonmarking
59 parameters together.
60 (todo-insert-item--apply-args): Adjust to signature of
61 todo-insert-item--basic and incorporate copy parameter.
62 Make small code improvements.
63 (todo-insert-item--next-param): Improve prompt and adjust it to
64 new parameter grouping. Remove obsolete code.
65 (todo-edit-item--param-key-alist)
66 (todo-edit-item--date-param-key-alist)
67 (todo-edit-done-item--param-key-alist): New defconsts.
68 (todo-edit-item--prompt): New variable.
69 (todo-edit-item--next-key): New function.
70 (todo-key-bindings-t): Bind "e" to todo-edit-item. Remove
71 bindings of deleted commands.
72
732014-05-04 Leo Liu <sdl.web@gmail.com>
74
75 * emacs-lisp/cl-macs.el (cl-deftype): Fix indentation.
76
772014-05-04 Glenn Morris <rgm@gnu.org>
78
79 * allout-widgets.el (allout-widgets-tally)
80 (allout-decorate-item-guides):
81 * menu-bar.el (menu-bar-positive-p):
82 * minibuffer.el (completion-pcm-complete-word-inserts-delimiters):
83 * progmodes/gdb-mi.el (gdbmi-same-start, gdbmi-is-number):
84 * progmodes/js.el (js--inside-param-list-p)
85 (js--inside-dojo-class-list-p, js--forward-destructuring-spec):
86 * progmodes/prolog.el (region-exists-p):
87 * progmodes/verilog-mode.el (verilog-scan-cache-ok-p):
88 * textmodes/reftex-parse.el (reftex-using-biblatex-p):
89 Doc fixes (replace `iff').
90
912014-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
92
93 * mpc.el (mpc-volume-mouse-set): Don't burp at the boundaries.
94
12014-05-04 Leo Liu <sdl.web@gmail.com> 952014-05-04 Leo Liu <sdl.web@gmail.com>
2 96
3 Support Chinese diary entries in calendar and diary. (Bug#17393) 97 Support Chinese diary entries in calendar and diary. (Bug#17393)
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index 65517607980..66ec0c333a7 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -266,7 +266,7 @@ decreases as obsolete widgets are garbage collected."
266(defvar allout-widgets-tally nil 266(defvar allout-widgets-tally nil
267 "Hash-table of existing allout widgets, for debugging. 267 "Hash-table of existing allout widgets, for debugging.
268 268
269Table is maintained iff `allout-widgets-maintain-tally' is non-nil. 269Table is maintained only if `allout-widgets-maintain-tally' is non-nil.
270 270
271The table contents will be out of sync if any widgets are created 271The table contents will be out of sync if any widgets are created
272or deleted while this variable is nil.") 272or deleted while this variable is nil.")
@@ -1852,7 +1852,7 @@ In their absence, the current guide column flags are used.
1852 1852
1853Optional PARENT-WIDGET is the widget for the item's parent item. 1853Optional PARENT-WIDGET is the widget for the item's parent item.
1854 1854
1855Optional HAS-SUCCESSOR is true iff the item is followed by a sibling. 1855Optional HAS-SUCCESSOR is true if the item is followed by a sibling.
1856 1856
1857We also hide the header-prefix string. 1857We also hide the header-prefix string.
1858 1858
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 09cca201c3c..ddc3a4843c9 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -787,7 +787,7 @@ corresponding todo file, displaying the corresponding category."
787 (kill-buffer) 787 (kill-buffer)
788 (keyboard-quit))))) 788 (keyboard-quit)))))
789 (save-excursion (todo-category-select)) 789 (save-excursion (todo-category-select))
790 (when add-item (todo-basic-insert-item))) 790 (when add-item (todo-insert-item--basic)))
791 (setq todo-show-first show-first) 791 (setq todo-show-first show-first)
792 (add-to-list 'todo-visited file))))) 792 (add-to-list 'todo-visited file)))))
793 793
@@ -947,7 +947,7 @@ Categories mode."
947 (todo-category-number category) 947 (todo-category-number category)
948 (todo-category-select) 948 (todo-category-select)
949 (goto-char (point-min)) 949 (goto-char (point-min))
950 (when add-item (todo-basic-insert-item)))))) 950 (when add-item (todo-insert-item--basic))))))
951 951
952(defun todo-next-item (&optional count) 952(defun todo-next-item (&optional count)
953 "Move point down to the beginning of the next item. 953 "Move point down to the beginning of the next item.
@@ -1216,9 +1216,19 @@ this command should be used with caution."
1216 (widen) 1216 (widen)
1217 (todo-edit-mode) 1217 (todo-edit-mode)
1218 (remove-overlays) 1218 (remove-overlays)
1219 (message "%s" (substitute-command-keys 1219 (display-warning 'todo (format "\
1220 (concat "Type \\[todo-edit-quit] to check file format " 1220
1221 "validity and return to Todo mode.\n")))) 1221Type %s to return to Todo mode.
1222
1223This also runs a file format check and signals an error if
1224the format has become invalid. However, this check cannot
1225tell if the number of items or categories changed, which
1226could result in the file containing inconsistent information.
1227You can repair this inconsistency by invoking the command
1228`todo-repair-categories-sexp', but this will revert any
1229renumbering of the categories you have made, so you will
1230have to renumber them again (see `(todo-mode) Reordering
1231Categories')." (substitute-command-keys "\\[todo-edit-quit]"))))
1222 1232
1223(defun todo-add-category (&optional file cat) 1233(defun todo-add-category (&optional file cat)
1224 "Add a new category to a todo file. 1234 "Add a new category to a todo file.
@@ -1267,7 +1277,7 @@ return the new category number."
1267 (setq todo-category-number num) 1277 (setq todo-category-number num)
1268 (todo-category-select) 1278 (todo-category-select)
1269 (when todo-add-item-if-new-category 1279 (when todo-add-item-if-new-category
1270 (todo-basic-insert-item))) 1280 (todo-insert-item--basic)))
1271 num)))) 1281 num))))
1272 1282
1273(defun todo-rename-category () 1283(defun todo-rename-category ()
@@ -1752,7 +1762,8 @@ marking of the next N items."
1752(defvar todo-insert-item--parameters) 1762(defvar todo-insert-item--parameters)
1753 1763
1754(defun todo-insert-item (&optional arg) 1764(defun todo-insert-item (&optional arg)
1755 "Insert a new todo item into a category. 1765 "Choose an item insertion operation and carry it out.
1766This inserts a new todo item into a category.
1756 1767
1757With no prefix argument ARG, add the item to the current 1768With no prefix argument ARG, add the item to the current
1758category; with one prefix argument (`C-u'), prompt for a category 1769category; with one prefix argument (`C-u'), prompt for a category
@@ -1766,117 +1777,31 @@ There are a number of item insertion parameters which can be
1766combined by entering specific keys to produce different insertion 1777combined by entering specific keys to produce different insertion
1767commands. After entering each key, a message shows which have 1778commands. After entering each key, a message shows which have
1768already been entered and which remain available. See 1779already been entered and which remain available. See
1769`todo-basic-insert-item' for details of the parameters and their 1780`(todo-mode) Inserting New Items' for details of the parameters,
1770effects." 1781their associated keys and their effects."
1771 (interactive "P") 1782 (interactive "P")
1772 (setq todo-insert-item--keys-so-far "i") 1783 (setq todo-insert-item--keys-so-far "i")
1773 (todo-insert-item--next-param nil (list arg) todo-insert-item--parameters)) 1784 (todo-insert-item--next-param nil (list arg) todo-insert-item--parameters))
1774 1785
1775(defun todo-basic-insert-item (&optional arg diary nonmarking date-type time 1786(defun todo-insert-item--basic (&optional arg diary-type date-type time where)
1776 region-or-here) 1787 "Function implementing the core of `todo-insert-item'."
1777 "Insert a new todo item into a category.
1778This is the function from which the generated Todo mode item
1779insertion commands derive.
1780
1781The generated commands have mnemonic key bindings based on the
1782arguments' values and their order in the command's argument list,
1783as follows: (1) for DIARY `d', (2) for NONMARKING `k', (3) for
1784DATE-TYPE either `c' for calendar or `d' for date or `n' for
1785weekday name, (4) for TIME `t', (5) for REGION-OR-HERE either `r'
1786for region or `h' for here. Sequences of these keys are appended
1787to the insertion prefix key `i'. Keys that allow a following
1788key (i.e., any but `r' or `h') must be doubled when used finally.
1789For example, the command bound to the key sequence `i y h' will
1790insert a new item with today's date, marked according to the
1791DIARY argument described below, and with priority according to
1792the HERE argument; `i y y' does the same except that the priority
1793is not given by HERE but by prompting.
1794
1795In command invocations, ARG is passed as a prefix argument as
1796follows. With no prefix argument, add the item to the current
1797category; with one prefix argument (`C-u'), prompt for a category
1798from the current todo file; with two prefix arguments (`C-u C-u'),
1799first prompt for a todo file, then a category in that file. If
1800a non-existing category is entered, ask whether to add it to the
1801todo file; if answered affirmatively, add the category and
1802insert the item there.
1803
1804The remaining arguments are set or left nil by the generated item
1805insertion commands; their meanings are described in the follows
1806paragraphs.
1807
1808When argument DIARY is non-nil, this overrides the intent of the
1809user option `todo-include-in-diary' for this item: if
1810`todo-include-in-diary' is nil, include the item in the Fancy
1811Diary display, and if it is non-nil, exclude the item from the
1812Fancy Diary display. When DIARY is nil, `todo-include-in-diary'
1813has its intended effect.
1814
1815When the item is included in the Fancy Diary display and the
1816argument NONMARKING is non-nil, this overrides the intent of the
1817user option `todo-diary-nonmarking' for this item: if
1818`todo-diary-nonmarking' is nil, append `diary-nonmarking-symbol'
1819to the item, and if it is non-nil, omit `diary-nonmarking-symbol'.
1820
1821The argument DATE-TYPE determines the content of the item's
1822mandatory date header string and how it is added:
1823- If DATE-TYPE is the symbol `calendar', the Calendar pops up and
1824 when the user puts the cursor on a date and hits RET, that
1825 date, in the format set by `calendar-date-display-form',
1826 becomes the date in the header.
1827- If DATE-TYPE is a string matching the regexp
1828 `todo-date-pattern', that string becomes the date in the
1829 header. This case is for the command
1830 `todo-insert-item-from-calendar' which is called from the
1831 Calendar.
1832- If DATE-TYPE is the symbol `date', the header contains the date
1833 in the format set by `calendar-date-display-form', with year,
1834 month and day individually prompted for (month with tab
1835 completion).
1836- If DATE-TYPE is the symbol `dayname' the header contains a
1837 weekday name instead of a date, prompted for with tab
1838 completion.
1839- If DATE-TYPE has any other value (including nil or none) the
1840 header contains the current date (in the format set by
1841 `calendar-date-display-form').
1842
1843With non-nil argument TIME prompt for a time string, which must
1844match `diary-time-regexp'. Typing `<return>' at the prompt
1845returns the current time, if the user option
1846`todo-always-add-time-string' is non-nil, otherwise the empty
1847string (i.e., no time string). If TIME is absent or nil, add or
1848omit the current time string according as
1849`todo-always-add-time-string' is non-nil or nil, respectively.
1850
1851The argument REGION-OR-HERE determines the source and location of
1852the new item:
1853- If the REGION-OR-HERE is the symbol `here', prompt for the text of
1854 the new item and, if the command was invoked with point in the todo
1855 items section of the current category, give the new item the
1856 priority of the item at point, lowering the latter's priority and
1857 the priority of the remaining items. If point is in the done items
1858 section of the category, insert the new item as the first todo item
1859 in the category. Likewise, if the command with `here' is invoked
1860 outside of the current category, jump to the chosen category and
1861 insert the new item as the first item in the category.
1862- If REGION-OR-HERE is the symbol `region', use the region of the
1863 current buffer as the text of the new item, depending on the
1864 value of user option `todo-use-only-highlighted-region': if
1865 this is non-nil, then use the region only when it is
1866 highlighted; otherwise, use the region regardless of
1867 highlighting. An error is signalled if there is no region in
1868 the current buffer. Prompt for the item's priority in the
1869 category (an integer between 1 and one more than the number of
1870 items in the category), and insert the item accordingly.
1871- If REGION-OR-HERE has any other value (in particular, nil or
1872 none), prompt for the text and the item's priority, and insert
1873 the item accordingly."
1874 ;; If invoked outside of Todo mode and there is not yet any Todo 1788 ;; If invoked outside of Todo mode and there is not yet any Todo
1875 ;; file, initialize one. 1789 ;; file, initialize one.
1876 (if (null (funcall todo-files-function)) 1790 (if (null (funcall todo-files-function))
1877 (todo-show) 1791 (todo-show)
1878 (let ((region (eq region-or-here 'region)) 1792 (let ((copy (eq where 'copy))
1879 (here (eq region-or-here 'here))) 1793 (region (eq where 'region))
1794 (here (eq where 'here))
1795 diary-item)
1796 (when copy
1797 (cond
1798 ((not (eq major-mode 'todo-mode))
1799 (user-error "You must be in Todo mode to copy a todo item"))
1800 ((todo-done-item-p)
1801 (user-error "You cannot copy a done item as a new todo item"))
1802 ((looking-at "^$")
1803 (user-error "Point must be on a todo item to copy it")))
1804 (setq diary-item (todo-diary-item-p)))
1880 (when region 1805 (when region
1881 (let (use-empty-active-region) 1806 (let (use-empty-active-region)
1882 (unless (and todo-use-only-highlighted-region (use-region-p)) 1807 (unless (and todo-use-only-highlighted-region (use-region-p))
@@ -1899,10 +1824,10 @@ the new item:
1899 todo-default-todo-file)))))) 1824 todo-default-todo-file))))))
1900 (cat (car cat+file)) 1825 (cat (car cat+file))
1901 (file (cdr cat+file)) 1826 (file (cdr cat+file))
1902 (new-item (if region 1827 (new-item (cond (copy (todo-item-string))
1903 (buffer-substring-no-properties 1828 (region (buffer-substring-no-properties
1904 (region-beginning) (region-end)) 1829 (region-beginning) (region-end)))
1905 (read-from-minibuffer "Todo item: "))) 1830 (t (read-from-minibuffer "Todo item: "))))
1906 (date-string (cond 1831 (date-string (cond
1907 ((eq date-type 'date) 1832 ((eq date-type 'date)
1908 (todo-read-date)) 1833 (todo-read-date))
@@ -1941,22 +1866,26 @@ the new item:
1941 (let ((buffer-read-only nil) 1866 (let ((buffer-read-only nil)
1942 (called-from-outside (not (and todo-mm (equal cat ocat)))) 1867 (called-from-outside (not (and todo-mm (equal cat ocat))))
1943 done-only item-added) 1868 done-only item-added)
1944 (setq new-item 1869 (unless copy
1945 ;; Add date, time and diary marking as required. 1870 (setq new-item
1946 (concat (if (not (and diary (not todo-include-in-diary))) 1871 ;; Add date, time and diary marking as required.
1947 todo-nondiary-start 1872 (concat (if (not (and diary-type
1948 (when (and nonmarking (not todo-diary-nonmarking)) 1873 (not todo-include-in-diary)))
1949 diary-nonmarking-symbol)) 1874 todo-nondiary-start
1950 date-string (when (and time-string ; Can be empty. 1875 (when (and (eq diary-type 'nonmarking)
1951 (not (zerop (length 1876 (not todo-diary-nonmarking))
1952 time-string)))) 1877 diary-nonmarking-symbol))
1953 (concat " " time-string)) 1878 date-string (when (and time-string ; Can be empty.
1954 (when (not (and diary (not todo-include-in-diary))) 1879 (not (zerop (length
1955 todo-nondiary-end) 1880 time-string))))
1956 " " new-item)) 1881 (concat " " time-string))
1957 ;; Indent newlines inserted by C-q C-j if nonspace char follows. 1882 (when (not (and diary-type
1958 (setq new-item (replace-regexp-in-string "\\(\n\\)[^[:blank:]]" 1883 (not todo-include-in-diary)))
1959 "\n\t" new-item nil nil 1)) 1884 todo-nondiary-end)
1885 " " new-item))
1886 ;; Indent newlines inserted by C-q C-j if nonspace char follows.
1887 (setq new-item (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
1888 "\n\t" new-item nil nil 1)))
1960 (unwind-protect 1889 (unwind-protect
1961 (progn 1890 (progn
1962 ;; Make sure the correct category is selected. There 1891 ;; Make sure the correct category is selected. There
@@ -2010,7 +1939,8 @@ the new item:
2010 ;; items are displayed in the window. 1939 ;; items are displayed in the window.
2011 (when item-added (recenter))) 1940 (when item-added (recenter)))
2012 (todo-update-count 'todo 1) 1941 (todo-update-count 'todo 1)
2013 (if (or diary todo-include-in-diary) (todo-update-count 'diary 1)) 1942 (when (or diary-item diary-type todo-include-in-diary)
1943 (todo-update-count 'diary 1))
2014 (todo-update-categories-sexp)))))) 1944 (todo-update-categories-sexp))))))
2015 1945
2016(defun todo-set-date-from-calendar () 1946(defun todo-set-date-from-calendar ()
@@ -2054,21 +1984,10 @@ prompt for a todo file and then for a category in it."
2054 (setq todo-date-from-calendar 1984 (setq todo-date-from-calendar
2055 (calendar-date-string (calendar-cursor-to-date t) t t)) 1985 (calendar-date-string (calendar-cursor-to-date t) t t))
2056 (calendar-exit) 1986 (calendar-exit)
2057 (todo-basic-insert-item arg nil nil todo-date-from-calendar)) 1987 (todo-insert-item--basic arg nil nil todo-date-from-calendar))
2058 1988
2059(define-key calendar-mode-map "it" 'todo-insert-item-from-calendar) 1989(define-key calendar-mode-map "it" 'todo-insert-item-from-calendar)
2060 1990
2061(defun todo-copy-item ()
2062 "Copy item at point and insert the copy as a new item."
2063 (interactive)
2064 (unless (or (todo-done-item-p) (looking-at "^$"))
2065 (let ((copy (todo-item-string))
2066 (diary-item (todo-diary-item-p)))
2067 (todo-set-item-priority copy (todo-current-category) t)
2068 (todo-update-count 'todo 1)
2069 (when diary-item (todo-update-count 'diary 1))
2070 (todo-update-categories-sexp))))
2071
2072(defun todo-delete-item () 1991(defun todo-delete-item ()
2073 "Delete at least one item in this category. 1992 "Delete at least one item in this category.
2074If there are marked items, delete all of these; otherwise, delete 1993If there are marked items, delete all of these; otherwise, delete
@@ -2115,64 +2034,91 @@ the item at point."
2115 (todo-prefix-overlays))) 2034 (todo-prefix-overlays)))
2116 (if ov (delete-overlay ov))))) 2035 (if ov (delete-overlay ov)))))
2117 2036
2118(defun todo-edit-item (&optional arg) 2037(defvar todo-edit-item--param-key-alist)
2119 "Edit the todo item at point. 2038(defvar todo-edit-done-item--param-key-alist)
2120With non-nil prefix argument ARG, include the item's date/time
2121header, making it also editable; otherwise, include only the item
2122content.
2123 2039
2124If the item consists of only one logical line, edit it in the 2040(defun todo-edit-item (&optional arg)
2125minibuffer; otherwise, edit it in Todo Edit mode." 2041 "Choose an editing operation for the current item and carry it out."
2126 (interactive "P") 2042 (interactive "P")
2127 (when (todo-item-string) 2043 (cond ((todo-done-item-p)
2128 (let* ((opoint (point)) 2044 (todo-edit-item--next-key todo-edit-done-item--param-key-alist))
2129 (start (todo-item-start)) 2045 ((todo-item-string)
2130 (item-beg (progn 2046 (todo-edit-item--next-key todo-edit-item--param-key-alist arg))))
2131 (re-search-forward 2047
2132 (concat todo-date-string-start todo-date-pattern 2048(defun todo-edit-item--text (&optional arg)
2133 "\\( " diary-time-regexp "\\)?" 2049 "Function providing the text editing facilities of `todo-edit-item'."
2134 (regexp-quote todo-nondiary-end) "?") 2050 (let* ((opoint (point))
2135 (line-end-position) t) 2051 (start (todo-item-start))
2136 (1+ (- (point) start)))) 2052 (end (save-excursion (todo-item-end)))
2137 (header (substring (todo-item-string) 0 item-beg)) 2053 (item-beg (progn
2138 (item (if arg (todo-item-string) 2054 (re-search-forward
2139 (substring (todo-item-string) item-beg))) 2055 (concat todo-date-string-start todo-date-pattern
2140 (multiline (> (length (split-string item "\n")) 1)) 2056 "\\( " diary-time-regexp "\\)?"
2141 (buffer-read-only nil)) 2057 (regexp-quote todo-nondiary-end) "?")
2142 (if multiline 2058 (line-end-position) t)
2143 (todo-edit-multiline-item) 2059 (1+ (- (point) start))))
2144 (let ((new (concat (if arg "" header) 2060 (include-header (eq arg 'include-header))
2145 (read-string "Edit: " (if arg 2061 (comment-edit (eq arg 'comment-edit))
2146 (cons item item-beg) 2062 (comment-delete (eq arg 'comment-delete))
2147 (cons item 0)))))) 2063 (header-string (substring (todo-item-string) 0 item-beg))
2148 (when arg 2064 (item (if (or include-header comment-edit comment-delete)
2149 (while (not (string-match (concat todo-date-string-start 2065 (todo-item-string)
2150 todo-date-pattern) new)) 2066 (substring (todo-item-string) item-beg)))
2151 (setq new (read-from-minibuffer 2067 (multiline (> (length (split-string item "\n")) 1))
2152 "Item must start with a date: " new)))) 2068 (comment (save-excursion
2153 ;; Ensure lines following hard newlines are indented. 2069 (todo-item-start)
2154 (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]" 2070 (re-search-forward
2155 "\n\t" new nil nil 1)) 2071 (concat " \\[" (regexp-quote todo-comment-string)
2156 ;; If user moved point during editing, make sure it moves back. 2072 ": \\([^]]+\\)\\]") end t)))
2157 (goto-char opoint) 2073 (prompt (if comment "Edit comment: " "Enter a comment: "))
2158 (todo-remove-item) 2074 (buffer-read-only nil))
2159 (todo-insert-with-overlays new) 2075 (cond
2160 (move-to-column item-beg)))))) 2076 ((or comment-edit comment-delete)
2161 2077 (save-excursion
2162(defun todo-edit-multiline-item () 2078 (todo-item-start)
2163 "Edit current todo item in Todo Edit mode. 2079 (if (re-search-forward (concat " \\[" (regexp-quote todo-comment-string)
2164Use of newlines invokes `todo-indent' to insure compliance with 2080 ": \\([^]]+\\)\\]") end t)
2165the format of Diary entries." 2081 (if comment-delete
2166 (interactive) 2082 (when (todo-y-or-n-p "Delete comment? ")
2167 (when (todo-item-string) 2083 (delete-region (match-beginning 0) (match-end 0)))
2168 (let ((buf todo-edit-buffer)) 2084 (replace-match (read-string prompt (cons (match-string 1) 1))
2169 (set-window-buffer (selected-window) 2085 nil nil nil 1))
2170 (set-buffer (make-indirect-buffer (buffer-name) buf))) 2086 (if comment-delete
2171 (narrow-to-region (todo-item-start) (todo-item-end)) 2087 (user-error "There is no comment to delete")
2172 (todo-edit-mode) 2088 (insert " [" todo-comment-string ": "
2173 (message "%s" (substitute-command-keys 2089 (prog1 (read-string prompt)
2174 (concat "Type \\[todo-edit-quit] " 2090 ;; If user moved point during editing,
2175 "to return to Todo mode.\n")))))) 2091 ;; make sure it moves back.
2092 (goto-char opoint)
2093 (todo-item-end))
2094 "]")))))
2095 ((or multiline (eq arg 'multiline))
2096 (let ((buf todo-edit-buffer))
2097 (set-window-buffer (selected-window)
2098 (set-buffer (make-indirect-buffer (buffer-name) buf)))
2099 (narrow-to-region (todo-item-start) (todo-item-end))
2100 (todo-edit-mode)
2101 (message "%s" (substitute-command-keys
2102 (concat "Type \\[todo-edit-quit] "
2103 "to return to Todo mode.\n")))))
2104 (t
2105 (let ((new (concat (if include-header "" header-string)
2106 (read-string "Edit: " (if include-header
2107 (cons item item-beg)
2108 (cons item 0))))))
2109 (when include-header
2110 (while (not (string-match (concat todo-date-string-start
2111 todo-date-pattern) new))
2112 (setq new (read-from-minibuffer
2113 "Item must start with a date: " new))))
2114 ;; Ensure lines following hard newlines are indented.
2115 (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
2116 "\n\t" new nil nil 1))
2117 ;; If user moved point during editing, make sure it moves back.
2118 (goto-char opoint)
2119 (todo-remove-item)
2120 (todo-insert-with-overlays new)
2121 (move-to-column item-beg))))))
2176 2122
2177(defun todo-edit-quit () 2123(defun todo-edit-quit ()
2178 "Return from Todo Edit mode to Todo mode. 2124 "Return from Todo Edit mode to Todo mode.
@@ -2225,35 +2171,15 @@ made in the number or names of categories."
2225 (todo-category-select) 2171 (todo-category-select)
2226 (goto-char (point-min)))))) 2172 (goto-char (point-min))))))
2227 2173
2228(defun todo-basic-edit-item-header (what &optional inc) 2174(defun todo-edit-item--header (what &optional inc)
2229 "Function underlying commands to edit item date/time header. 2175 "Function providing header editing facilities of `todo-edit-item'."
2230
2231The argument WHAT (passed by invoking commands) specifies what
2232part of the header to edit; possible values are these symbols:
2233`date', to edit the year, month, and day of the date string;
2234`time', to edit just the time string; `calendar', to select the
2235date from the Calendar; `today', to set the date to today's date;
2236`dayname', to set the date string to the name of a day or to
2237change the day name; and `year', `month' or `day', to edit only
2238these respective parts of the date string (`day' is the number of
2239the given day of the month, and `month' is either the name of the
2240given month or its number, depending on the value of
2241`calendar-date-display-form').
2242
2243The optional argument INC is a positive or negative integer
2244\(passed by invoking commands as a numerical prefix argument)
2245that in conjunction with the WHAT values `year', `month' or
2246`day', increments or decrements the specified date string
2247component by the specified number of suitable units, i.e., years,
2248months, or days, with automatic adjustment of the other date
2249string components as necessary.
2250
2251If there are marked items, apply the same edit to all of these;
2252otherwise, edit just the item at point."
2253 (let* ((cat (todo-current-category)) 2176 (let* ((cat (todo-current-category))
2254 (marked (assoc cat todo-categories-with-marks)) 2177 (marked (assoc cat todo-categories-with-marks))
2255 (first t) 2178 (first t)
2256 (todo-date-from-calendar t) 2179 (todo-date-from-calendar t)
2180 ;; INC must be an integer, but users could pass it via
2181 ;; `todo-edit-item' as e.g. `-' or `C-u'.
2182 (inc (prefix-numeric-value inc))
2257 (buffer-read-only nil) 2183 (buffer-read-only nil)
2258 ndate ntime year monthname month day 2184 ndate ntime year monthname month day
2259 dayname) ; Needed by calendar-date-display-form. 2185 dayname) ; Needed by calendar-date-display-form.
@@ -2372,7 +2298,8 @@ otherwise, edit just the item at point."
2372 ((or (string= omonth "*") (string= omonthname "*")) 2298 ((or (string= omonth "*") (string= omonthname "*"))
2373 (setq dd (+ dd inc)) 2299 (setq dd (+ dd inc))
2374 (if (> dd 31) 2300 (if (> dd 31)
2375 (user-error "A month cannot have more than 31 days") 2301 (user-error
2302 "A month cannot have more than 31 days")
2376 (number-to-string dd))) 2303 (number-to-string dd)))
2377 ;; Increment or decrement day by INC, 2304 ;; Increment or decrement day by INC,
2378 ;; adjusting month and year if necessary 2305 ;; adjusting month and year if necessary
@@ -2414,65 +2341,8 @@ otherwise, edit just the item at point."
2414 (todo-forward-item) 2341 (todo-forward-item)
2415 (goto-char (point-max)))))))) 2342 (goto-char (point-max))))))))
2416 2343
2417(defun todo-edit-item-header () 2344(defun todo-edit-item--diary-inclusion (&optional nonmarking)
2418 "Interactively edit at least the date of item's date/time header. 2345 "Function providing diary marking facilities of `todo-edit-item'."
2419If user option `todo-always-add-time-string' is non-nil, also
2420edit item's time string."
2421 (interactive)
2422 (todo-basic-edit-item-header 'date)
2423 (when todo-always-add-time-string
2424 (todo-edit-item-time)))
2425
2426(defun todo-edit-item-time ()
2427 "Interactively edit the time string of item's date/time header."
2428 (interactive)
2429 (todo-basic-edit-item-header 'time))
2430
2431(defun todo-edit-item-date-from-calendar ()
2432 "Interactively edit item's date using the Calendar."
2433 (interactive)
2434 (todo-basic-edit-item-header 'calendar))
2435
2436(defun todo-edit-item-date-to-today ()
2437 "Set item's date to today's date."
2438 (interactive)
2439 (todo-basic-edit-item-header 'today))
2440
2441(defun todo-edit-item-date-day-name ()
2442 "Replace item's date with the name of a day of the week."
2443 (interactive)
2444 (todo-basic-edit-item-header 'dayname))
2445
2446(defun todo-edit-item-date-year (&optional inc)
2447 "Interactively edit the year of item's date string.
2448With prefix argument INC a positive or negative integer,
2449increment or decrement the year by INC."
2450 (interactive "p")
2451 (todo-basic-edit-item-header 'year inc))
2452
2453(defun todo-edit-item-date-month (&optional inc)
2454 "Interactively edit the month of item's date string.
2455With prefix argument INC a positive or negative integer,
2456increment or decrement the month by INC."
2457 (interactive "p")
2458 (todo-basic-edit-item-header 'month inc))
2459
2460(defun todo-edit-item-date-day (&optional inc)
2461 "Interactively edit the day of the month of item's date string.
2462With prefix argument INC a positive or negative integer,
2463increment or decrement the day by INC."
2464 (interactive "p")
2465 (todo-basic-edit-item-header 'day inc))
2466
2467(defun todo-edit-item-diary-inclusion ()
2468 "Change diary status of one or more todo items in this category.
2469That is, insert `todo-nondiary-marker' if the candidate items
2470lack this marking; otherwise, remove it.
2471
2472If there are marked todo items, change the diary status of all
2473and only these, otherwise change the diary status of the item at
2474point."
2475 (interactive)
2476 (let ((buffer-read-only) 2346 (let ((buffer-read-only)
2477 (marked (assoc (todo-current-category) 2347 (marked (assoc (todo-current-category)
2478 todo-categories-with-marks))) 2348 todo-categories-with-marks)))
@@ -2488,17 +2358,30 @@ point."
2488 (end (save-excursion 2358 (end (save-excursion
2489 (or (todo-time-string-matcher lim) 2359 (or (todo-time-string-matcher lim)
2490 (todo-date-string-matcher lim))))) 2360 (todo-date-string-matcher lim)))))
2491 (if (looking-at (regexp-quote todo-nondiary-start)) 2361 (if nonmarking
2492 (progn 2362 (if (looking-at (regexp-quote diary-nonmarking-symbol))
2493 (replace-match "") 2363 (replace-match "")
2494 (search-forward todo-nondiary-end (1+ end) t) 2364 (when (looking-at (regexp-quote todo-nondiary-start))
2495 (replace-match "") 2365 (save-excursion
2496 (todo-update-count 'diary 1)) 2366 (replace-match "")
2497 (when end 2367 (search-forward todo-nondiary-end (1+ end) t)
2498 (insert todo-nondiary-start) 2368 (replace-match "")
2499 (goto-char (1+ end)) 2369 (todo-update-count 'diary 1)))
2500 (insert todo-nondiary-end) 2370 (insert diary-nonmarking-symbol))
2501 (todo-update-count 'diary -1))))) 2371 (if (looking-at (regexp-quote todo-nondiary-start))
2372 (progn
2373 (replace-match "")
2374 (search-forward todo-nondiary-end (1+ end) t)
2375 (replace-match "")
2376 (todo-update-count 'diary 1))
2377 (when end
2378 (when (looking-at (regexp-quote diary-nonmarking-symbol))
2379 (replace-match "")
2380 (setq end (1- end))) ; Since we deleted nonmarking symbol.
2381 (insert todo-nondiary-start)
2382 (goto-char (1+ end))
2383 (insert todo-nondiary-end)
2384 (todo-update-count 'diary -1))))))
2502 (unless marked (throw 'stop nil)) 2385 (unless marked (throw 'stop nil))
2503 (todo-forward-item))))) 2386 (todo-forward-item)))))
2504 (todo-update-categories-sexp))) 2387 (todo-update-categories-sexp)))
@@ -2524,6 +2407,9 @@ items."
2524 (todo-date-string-matcher lim))))) 2407 (todo-date-string-matcher lim)))))
2525 (if arg 2408 (if arg
2526 (unless (looking-at (regexp-quote todo-nondiary-start)) 2409 (unless (looking-at (regexp-quote todo-nondiary-start))
2410 (when (looking-at (regexp-quote diary-nonmarking-symbol))
2411 (replace-match "")
2412 (setq end (1- end))) ; Since we deleted nonmarking symbol.
2527 (insert todo-nondiary-start) 2413 (insert todo-nondiary-start)
2528 (goto-char (1+ end)) 2414 (goto-char (1+ end))
2529 (insert todo-nondiary-end)) 2415 (insert todo-nondiary-end))
@@ -2538,33 +2424,6 @@ items."
2538 (- todo-count diary-count)))) 2424 (- todo-count diary-count))))
2539 (todo-update-categories-sexp))))) 2425 (todo-update-categories-sexp)))))
2540 2426
2541(defun todo-edit-item-diary-nonmarking ()
2542 "Change non-marking of one or more diary items in this category.
2543That is, insert `diary-nonmarking-symbol' if the candidate items
2544lack this marking; otherwise, remove it.
2545
2546If there are marked todo items, change the non-marking status of
2547all and only these, otherwise change the non-marking status of
2548the item at point."
2549 (interactive)
2550 (let ((buffer-read-only)
2551 (marked (assoc (todo-current-category)
2552 todo-categories-with-marks)))
2553 (catch 'stop
2554 (save-excursion
2555 (when marked (goto-char (point-min)))
2556 (while (not (eobp))
2557 (if (todo-done-item-p)
2558 (throw 'stop (message "Done items cannot be edited"))
2559 (unless (and marked (not (todo-marked-item-p)))
2560 (todo-item-start)
2561 (unless (looking-at (regexp-quote todo-nondiary-start))
2562 (if (looking-at (regexp-quote diary-nonmarking-symbol))
2563 (replace-match "")
2564 (insert diary-nonmarking-symbol))))
2565 (unless marked (throw 'stop nil))
2566 (todo-forward-item)))))))
2567
2568(defun todo-edit-category-diary-nonmarking (arg) 2427(defun todo-edit-category-diary-nonmarking (arg)
2569 "Add `diary-nonmarking-symbol' to all diary items in this category. 2428 "Add `diary-nonmarking-symbol' to all diary items in this category.
2570With prefix ARG, remove `diary-nonmarking-symbol' from all diary 2429With prefix ARG, remove `diary-nonmarking-symbol' from all diary
@@ -2574,16 +2433,16 @@ items in this category."
2574 (goto-char (point-min)) 2433 (goto-char (point-min))
2575 (let (buffer-read-only) 2434 (let (buffer-read-only)
2576 (catch 'stop 2435 (catch 'stop
2577 (while (not (eobp)) 2436 (while (not (eobp))
2578 (if (todo-done-item-p) ; We've gone too far. 2437 (if (todo-done-item-p) ; We've gone too far.
2579 (throw 'stop nil) 2438 (throw 'stop nil)
2580 (unless (looking-at (regexp-quote todo-nondiary-start)) 2439 (unless (looking-at (regexp-quote todo-nondiary-start))
2581 (if arg 2440 (if arg
2582 (when (looking-at (regexp-quote diary-nonmarking-symbol)) 2441 (when (looking-at (regexp-quote diary-nonmarking-symbol))
2583 (replace-match "")) 2442 (replace-match ""))
2584 (unless (looking-at (regexp-quote diary-nonmarking-symbol)) 2443 (unless (looking-at (regexp-quote diary-nonmarking-symbol))
2585 (insert diary-nonmarking-symbol)))) 2444 (insert diary-nonmarking-symbol))))
2586 (todo-forward-item))))))) 2445 (todo-forward-item)))))))
2587 2446
2588(defun todo-set-item-priority (&optional item cat new arg) 2447(defun todo-set-item-priority (&optional item cat new arg)
2589 "Prompt for and set ITEM's priority in CATegory. 2448 "Prompt for and set ITEM's priority in CATegory.
@@ -2970,32 +2829,6 @@ visible."
2970 ;; When done items are shown, put cursor on first just done item. 2829 ;; When done items are shown, put cursor on first just done item.
2971 (when opoint (goto-char opoint))))))) 2830 (when opoint (goto-char opoint)))))))
2972 2831
2973(defun todo-edit-done-item-comment (&optional arg)
2974 "Add a comment to this done item or edit an existing comment.
2975With prefix ARG delete an existing comment."
2976 (interactive "P")
2977 (when (todo-done-item-p)
2978 (let ((item (todo-item-string))
2979 (opoint (point))
2980 (end (save-excursion (todo-item-end)))
2981 comment buffer-read-only)
2982 (save-excursion
2983 (todo-item-start)
2984 (if (re-search-forward (concat " \\["
2985 (regexp-quote todo-comment-string)
2986 ": \\([^]]+\\)\\]") end t)
2987 (if arg
2988 (when (todo-y-or-n-p "Delete comment? ")
2989 (delete-region (match-beginning 0) (match-end 0)))
2990 (setq comment (read-string "Edit comment: "
2991 (cons (match-string 1) 1)))
2992 (replace-match comment nil nil nil 1))
2993 (setq comment (read-string "Enter a comment: "))
2994 ;; If user moved point during editing, make sure it moves back.
2995 (goto-char opoint)
2996 (todo-item-end)
2997 (insert " [" todo-comment-string ": " comment "]"))))))
2998
2999(defun todo-item-undone () 2832(defun todo-item-undone ()
3000 "Restore at least one done item to this category's todo section. 2833 "Restore at least one done item to this category's todo section.
3001Prompt for the new priority. If there are marked items, undo all 2834Prompt for the new priority. If there are marked items, undo all
@@ -5451,7 +5284,7 @@ of each other."
5451 (forward-line))))) 5284 (forward-line)))))
5452 5285
5453;; ----------------------------------------------------------------------------- 5286;; -----------------------------------------------------------------------------
5454;;; Utilities for generating item insertion commands and key bindings 5287;;; Generating and applying item insertion and editing key sequences
5455;; ----------------------------------------------------------------------------- 5288;; -----------------------------------------------------------------------------
5456 5289
5457;; Thanks to Stefan Monnier for suggesting dynamically generating item 5290;; Thanks to Stefan Monnier for suggesting dynamically generating item
@@ -5462,7 +5295,7 @@ of each other."
5462;; uses dynamic binding. 5295;; uses dynamic binding.
5463 5296
5464(defconst todo-insert-item--parameters 5297(defconst todo-insert-item--parameters
5465 '((default copy) diary nonmarking (calendar date dayname) time (here region)) 5298 '((default copy) (diary nonmarking) (calendar date dayname) time (here region))
5466 "List of all item insertion parameters. 5299 "List of all item insertion parameters.
5467Passed by `todo-insert-item' to `todo-insert-item--next-param' to 5300Passed by `todo-insert-item' to `todo-insert-item--next-param' to
5468dynamically create item insertion commands.") 5301dynamically create item insertion commands.")
@@ -5527,25 +5360,20 @@ occupied by `nil'."
5527 (list (car (todo-insert-item--argsleft 5360 (list (car (todo-insert-item--argsleft
5528 (todo-insert-item--this-key) 5361 (todo-insert-item--this-key)
5529 todo-insert-item--argsleft))))) 5362 todo-insert-item--argsleft)))))
5530 (arglist (unless (= 5 (length args)) 5363 (arglist (unless (= 4 (length args))
5531 (let ((v (make-vector 5 nil)) elt) 5364 (let ((v (make-vector 4 nil)) elt)
5532 (while args 5365 (while args
5533 (setq elt (pop args)) 5366 (setq elt (pop args))
5534 (cond ((eq elt 'diary) 5367 (cond ((memq elt '(diary nonmarking))
5535 (aset v 0 elt)) 5368 (aset v 0 elt))
5536 ((eq elt 'nonmarking) 5369 ((memq elt '(calendar date dayname))
5537 (aset v 1 elt)) 5370 (aset v 1 elt))
5538 ((or (eq elt 'calendar)
5539 (eq elt 'date)
5540 (eq elt 'dayname))
5541 (aset v 2 elt))
5542 ((eq elt 'time) 5371 ((eq elt 'time)
5543 (aset v 3 elt)) 5372 (aset v 2 elt))
5544 ((or (eq elt 'here) 5373 ((memq elt '(copy here region))
5545 (eq elt 'region)) 5374 (aset v 3 elt))))
5546 (aset v 4 elt))))
5547 (append v nil))))) 5375 (append v nil)))))
5548 (apply #'todo-basic-insert-item (nconc arg arglist)))) 5376 (apply #'todo-insert-item--basic (nconc arg arglist))))
5549 5377
5550(defun todo-insert-item--next-param (last args argsleft) 5378(defun todo-insert-item--next-param (last args argsleft)
5551 "Build item insertion command from LAST, ARGS and ARGSLEFT and call it. 5379 "Build item insertion command from LAST, ARGS and ARGSLEFT and call it.
@@ -5554,35 +5382,31 @@ already entered and those still available."
5554 (cl-assert argsleft) 5382 (cl-assert argsleft)
5555 (let* ((map (make-sparse-keymap)) 5383 (let* ((map (make-sparse-keymap))
5556 (prompt nil) 5384 (prompt nil)
5557 (addprompt (lambda (k name) 5385 (addprompt
5558 (setq prompt (concat prompt 5386 (lambda (k name)
5559 (format (concat 5387 (setq prompt
5560 (if (or (eq name 'default) 5388 (concat prompt
5561 (eq name 'calendar) 5389 (format
5562 (eq name 'here)) 5390 (concat
5563 " { " " ") 5391 (if (memq name '(default diary calendar here))
5564 "%s=>%s" 5392 " { " " ")
5565 (when (or (eq name 'copy) 5393 "%s=>%s"
5566 (eq name 'dayname) 5394 (when (memq name '(copy nonmarking dayname region))
5567 (eq name 'region)) 5395 " }"))
5568 " }")) 5396 (propertize k 'face 'todo-key-prompt)
5569 (propertize k 'face 5397 name))))))
5570 'todo-key-prompt)
5571 name))))))
5572 (setq todo-insert-item--args args) 5398 (setq todo-insert-item--args args)
5573 (setq todo-insert-item--argsleft argsleft) 5399 (setq todo-insert-item--argsleft argsleft)
5574 (when last 5400 (when last
5575 (cond ((eq last 'default) 5401 (if (memq last '(default copy))
5576 (apply #'todo-basic-insert-item (car todo-insert-item--args)) 5402 (progn
5577 (setq todo-insert-item--argsleft nil)) 5403 (setq todo-insert-item--argsleft nil)
5578 ((eq last 'copy) 5404 (todo-insert-item--apply-args))
5579 (todo-copy-item) 5405 (let ((k (todo-insert-item--keyof last)))
5580 (setq todo-insert-item--argsleft nil)) 5406 (funcall addprompt k (make-symbol (concat (symbol-name last) ":GO!")))
5581 (t (let ((k (todo-insert-item--keyof last))) 5407 (define-key map (todo-insert-item--keyof last)
5582 (funcall addprompt k 'GO!) 5408 (lambda () (interactive)
5583 (define-key map (todo-insert-item--keyof last) 5409 (todo-insert-item--apply-args))))))
5584 (lambda () (interactive)
5585 (todo-insert-item--apply-args)))))))
5586 (while todo-insert-item--argsleft 5410 (while todo-insert-item--argsleft
5587 (let ((x (car todo-insert-item--argsleft))) 5411 (let ((x (car todo-insert-item--argsleft)))
5588 (setq todo-insert-item--newargsleft (cdr todo-insert-item--argsleft)) 5412 (setq todo-insert-item--newargsleft (cdr todo-insert-item--argsleft))
@@ -5594,14 +5418,6 @@ already entered and those still available."
5594 (lambda () (interactive) 5418 (lambda () (interactive)
5595 (todo-insert-item--apply-args)) 5419 (todo-insert-item--apply-args))
5596 (lambda () (interactive) 5420 (lambda () (interactive)
5597 (when (equal "k" (todo-insert-item--this-key))
5598 (unless (string-match "y" todo-insert-item--keys-so-far)
5599 (when (y-or-n-p (concat "`k' only takes effect with `y';"
5600 " add `y'? "))
5601 (setq todo-insert-item--keys-so-far
5602 (concat todo-insert-item--keys-so-far " y"))
5603 (setq todo-insert-item--args
5604 (nconc todo-insert-item--args (list 'diary))))))
5605 (setq todo-insert-item--keys-so-far 5421 (setq todo-insert-item--keys-so-far
5606 (concat todo-insert-item--keys-so-far " " 5422 (concat todo-insert-item--keys-so-far " "
5607 (todo-insert-item--this-key))) 5423 (todo-insert-item--this-key)))
@@ -5617,11 +5433,74 @@ already entered and those still available."
5617 (todo-insert-item--this-key) 5433 (todo-insert-item--this-key)
5618 todo-insert-item--argsleft))))))))) 5434 todo-insert-item--argsleft)))))))))
5619 (setq todo-insert-item--argsleft todo-insert-item--newargsleft)) 5435 (setq todo-insert-item--argsleft todo-insert-item--newargsleft))
5620 (when prompt (message "Enter a key (so far `%s'): %s" 5436 (when prompt (message "Press a key (so far `%s'): %s"
5621 todo-insert-item--keys-so-far prompt)) 5437 todo-insert-item--keys-so-far prompt))
5622 (set-transient-map map) 5438 (set-transient-map map)
5623 (setq todo-insert-item--argsleft argsleft))) 5439 (setq todo-insert-item--argsleft argsleft)))
5624 5440
5441(defconst todo-edit-item--param-key-alist
5442 '((edit . "e")
5443 (header . "h")
5444 (multiline . "m")
5445 (diary . "y")
5446 (nonmarking . "k")
5447 (date . "d")
5448 (time . "t"))
5449 "Alist of item editing parameters and their keys.")
5450
5451(defconst todo-edit-item--date-param-key-alist
5452 '((full . "f")
5453 (calendar . "c")
5454 (today . "a")
5455 (dayname . "n")
5456 (year . "y")
5457 (month . "m")
5458 (daynum . "d"))
5459 "Alist of item date editing parameters and their keys.")
5460
5461(defconst todo-edit-done-item--param-key-alist
5462 '((add/edit . "c")
5463 (delete . "d"))
5464 "Alist of done item comment editing parameters and their keys.")
5465
5466(defvar todo-edit-item--prompt "Press a key (so far `e'): ")
5467
5468(defun todo-edit-item--next-key (params &optional arg)
5469 (let* ((map (make-sparse-keymap))
5470 (p->k (mapconcat (lambda (elt)
5471 (format "%s=>%s"
5472 (propertize (cdr elt) 'face
5473 'todo-key-prompt)
5474 (concat (symbol-name (car elt))
5475 (when (memq (car elt)
5476 '(add/edit delete))
5477 " comment"))))
5478 params " "))
5479 (this-key (char-to-string
5480 (read-key (concat todo-edit-item--prompt p->k))))
5481 (this-param (car (rassoc this-key params))))
5482 (pcase this-param
5483 (`edit (todo-edit-item--text))
5484 (`header (todo-edit-item--text 'include-header))
5485 (`multiline (todo-edit-item--text 'multiline))
5486 (`add/edit (todo-edit-item--text 'comment-edit))
5487 (`delete (todo-edit-item--text 'comment-delete))
5488 (`diary (todo-edit-item--diary-inclusion))
5489 (`nonmarking (todo-edit-item--diary-inclusion 'nonmarking))
5490 (`date (let ((todo-edit-item--prompt "Press a key (so far `e d'): "))
5491 (todo-edit-item--next-key
5492 todo-edit-item--date-param-key-alist arg)))
5493 (`full (progn (todo-edit-item--header 'date)
5494 (when todo-always-add-time-string
5495 (todo-edit-item--header 'time))))
5496 (`calendar (todo-edit-item--header 'calendar))
5497 (`today (todo-edit-item--header 'today))
5498 (`dayname (todo-edit-item--header 'dayname))
5499 (`year (todo-edit-item--header 'year arg))
5500 (`month (todo-edit-item--header 'month arg))
5501 (`daynum (todo-edit-item--header 'day arg))
5502 (`time (todo-edit-item--header 'time)))))
5503
5625;; ----------------------------------------------------------------------------- 5504;; -----------------------------------------------------------------------------
5626;;; Todo minibuffer utilities 5505;;; Todo minibuffer utilities
5627;; ----------------------------------------------------------------------------- 5506;; -----------------------------------------------------------------------------
@@ -6322,19 +6201,7 @@ Filtered Items mode following todo (not done) items."
6322 ("Fym" todo-filter-diary-items-multifile) 6201 ("Fym" todo-filter-diary-items-multifile)
6323 ("Fxx" todo-filter-regexp-items) 6202 ("Fxx" todo-filter-regexp-items)
6324 ("Fxm" todo-filter-regexp-items-multifile) 6203 ("Fxm" todo-filter-regexp-items-multifile)
6325 ("ee" todo-edit-item) 6204 ("e" todo-edit-item)
6326 ("em" todo-edit-multiline-item)
6327 ("edt" todo-edit-item-header)
6328 ("edc" todo-edit-item-date-from-calendar)
6329 ("eda" todo-edit-item-date-to-today)
6330 ("edn" todo-edit-item-date-day-name)
6331 ("edy" todo-edit-item-date-year)
6332 ("edm" todo-edit-item-date-month)
6333 ("edd" todo-edit-item-date-day)
6334 ("et" todo-edit-item-time)
6335 ("eyy" todo-edit-item-diary-inclusion)
6336 ("eyk" todo-edit-item-diary-nonmarking)
6337 ("ec" todo-edit-done-item-comment)
6338 ("d" todo-item-done) 6205 ("d" todo-item-done)
6339 ("i" todo-insert-item) 6206 ("i" todo-insert-item)
6340 ("k" todo-delete-item) 6207 ("k" todo-delete-item)
@@ -6452,64 +6319,74 @@ Filtered Items mode following todo (not done) items."
6452 map) 6319 map)
6453 "Todo Filtered Items mode keymap.") 6320 "Todo Filtered Items mode keymap.")
6454 6321
6455;; FIXME: Is it worth having a menu and if so, which commands? 6322(easy-menu-define
6456;; (easy-menu-define 6323 todo-menu todo-mode-map "Todo Menu"
6457;; todo-menu todo-mode-map "Todo Menu" 6324 '("Todo"
6458;; '("Todo" 6325 ("Navigation"
6459;; ("Navigation" 6326 ["Next Item" todo-next-item t]
6460;; ["Next Item" todo-forward-item t] 6327 ["Previous Item" todo-previous-item t]
6461;; ["Previous Item" todo-backward-item t] 6328 "---"
6462;; "---" 6329 ["Next Category" todo-forward-category t]
6463;; ["Next Category" todo-forward-category t] 6330 ["Previous Category" todo-backward-category t]
6464;; ["Previous Category" todo-backward-category t] 6331 ["Jump to Another Category" todo-jump-to-category t]
6465;; ["Jump to Category" todo-jump-to-category t] 6332 "---"
6466;; "---" 6333 ["Visit Another Todo File" todo-show t]
6467;; ["Search Todo File" todo-search t] 6334 ["Visit Archive" todo-find-archive t]
6468;; ["Clear Highlighting on Search Matches" todo-category-done t]) 6335 ["Visit Filtered Items File" todo-find-filtered-items-file t]
6469;; ("Display" 6336 )
6470;; ["List Current Categories" todo-show-categories-table t] 6337 ("Editing"
6471;; ;; ["List Categories Alphabetically" todo-display-categories-alphabetically t] 6338 ["Insert New Item" todo-insert-item t]
6472;; ["Turn Item Highlighting on/off" todo-toggle-item-highlighting t] 6339 ["Edit Item" todo-edit-item t]
6473;; ["Turn Item Numbering on/off" todo-toggle-prefix-numbers t] 6340 ["Lower Item Priority" todo-lower-item-priority t]
6474;; ["Turn Item Time Stamp on/off" todo-toggle-item-header t] 6341 ["Raise Item Priority" todo-raise-item-priority t]
6475;; ["View/Hide Done Items" todo-toggle-view-done-items t] 6342 ["Set Item Priority" todo-set-item-priority t]
6476;; "---" 6343 ["Mark/Unmark Item" todo-toggle-mark-item t]
6477;; ["View Diary Items" todo-filter-diary-items t] 6344 ["Move (Recategorize) Item" todo-move-item t]
6478;; ["View Top Priority Items" todo-filter-top-priorities t] 6345 ["Delete Item" todo-delete-item t]
6479;; ["View Multifile Top Priority Items" todo-filter-top-priorities-multifile t] 6346 ["Mark and Bury Done Item" todo-item-done t]
6480;; "---" 6347 ["Undo Done Item" todo-item-undone t]
6481;; ["Print Category" todo-print-buffer t]) 6348 ["Archive Done Item" todo-archive-done-item t]
6482;; ("Editing" 6349 "---"
6483;; ["Insert New Item" todo-insert-item t] 6350 ["Add New Category" todo-add-category t]
6484;; ["Insert Item Here" todo-insert-item-here t] 6351 ["Rename Current Category" todo-rename-category t]
6485;; ("More Insertion Commands") 6352 ["Delete Current Category" todo-delete-category t]
6486;; ["Edit Item" todo-edit-item t] 6353 ["Move Current Category" todo-move-category t]
6487;; ["Edit Multiline Item" todo-edit-multiline-item t] 6354 ["Merge Current Category" todo-merge-category t]
6488;; ["Edit Item Header" todo-edit-item-header t] 6355 "---"
6489;; ["Edit Item Date" todo-edit-item-date t] 6356 ["Add New Todo File" todo-add-file t]
6490;; ["Edit Item Time" todo-edit-item-time t] 6357 ["Rename Todo File" todo-rename-file t]
6491;; "---" 6358 ["Delete Todo File" todo-delete-file t]
6492;; ["Lower Item Priority" todo-lower-item-priority t] 6359 ["Edit Todo File" todo-edit-file t]
6493;; ["Raise Item Priority" todo-raise-item-priority t] 6360 )
6494;; ["Set Item Priority" todo-set-item-priority t] 6361 ("Searching and Item Filtering"
6495;; ["Move (Recategorize) Item" todo-move-item t] 6362 ["Search Todo File" todo-search t]
6496;; ["Delete Item" todo-delete-item t] 6363 ["Clear Match Highlighting" todo-clear-matches t]
6497;; ["Undo Done Item" todo-item-undone t] 6364 "---"
6498;; ["Mark/Unmark Item for Diary" todo-toggle-item-diary-inclusion t] 6365 ["Set Top Priorities in File" todo-set-top-priorities-in-file t]
6499;; ["Mark/Unmark Items for Diary" todo-edit-item-diary-inclusion t] 6366 ["Set Top Priorities in Category" todo-set-top-priorities-in-category t]
6500;; ["Mark & Hide Done Item" todo-item-done t] 6367 ["Filter Top Priorities" todo-filter-top-priorities t]
6501;; ["Archive Done Items" todo-archive-category-done-items t] 6368 ["Filter Multifile Top Priorities" todo-filter-top-priorities-multifile t]
6502;; "---" 6369 ["Filter Diary Items" todo-filter-diary-items t]
6503;; ["Add New Todo File" todo-add-file t] 6370 ["Filter Multifile Diary Items" todo-filter-diary-items-multifile t]
6504;; ["Add New Category" todo-add-category t] 6371 ["Filter Regexp" todo-filter-regexp-items t]
6505;; ["Delete Current Category" todo-delete-category t] 6372 ["Filter Multifile Regexp" todo-filter-regexp-items-multifile t]
6506;; ["Rename Current Category" todo-rename-category t] 6373 )
6507;; "---" 6374 ("Display and Printing"
6508;; ["Save Todo File" todo-save t] 6375 ["Show/Hide Done Items" todo-toggle-view-done-items t]
6509;; ) 6376 ["Show/Hide Done Items Only" todo-toggle-view-done-only t]
6510;; "---" 6377 ["Show/Hide Item Highlighting" todo-toggle-item-highlighting t]
6511;; ["Quit" todo-quit t] 6378 ["Show/Hide Item Numbering" todo-toggle-prefix-numbers t]
6512;; )) 6379 ["Show/Hide Item Header" todo-toggle-item-header t]
6380 "---"
6381 ["Display Table of Categories" todo-show-categories-table t]
6382 "---"
6383 ["Print Category" todo-print-buffer t]
6384 ["Print Category to File" todo-print-buffer-to-file t]
6385 )
6386 "---"
6387 ["Save Todo File" todo-save t]
6388 ["Quit Todo Mode" todo-quit t]
6389 ))
6513 6390
6514;; ----------------------------------------------------------------------------- 6391;; -----------------------------------------------------------------------------
6515;;; Hook functions and mode definitions 6392;;; Hook functions and mode definitions
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 5433485825b..56f186fe588 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,11 @@
12014-05-01 Glenn Morris <rgm@gnu.org>
2
3 * ede.el (ede-project-directories, ede-check-project-directory):
4 * semantic/ia-sb.el (semantic-ia-sb-show-doc):
5 * semantic/tag.el (semantic-tag-in-buffer-p):
6 * semantic/bovine/c.el (semantic-tag-abstract-p):
7 Doc fixes (replace `iff').
8
12014-04-01 Glenn Morris <rgm@gnu.org> 92014-04-01 Glenn Morris <rgm@gnu.org>
2 10
3 * ede/emacs.el (ede-emacs-version): Update AC_INIT regexp. (Bug#17160) 11 * ede/emacs.el (ede-emacs-version): Update AC_INIT regexp. (Bug#17160)
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index 998df78735a..a9a53d776e2 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -100,7 +100,7 @@ target willing to take the file. 'never means never perform the check."
100If the value is t, EDE may search in any directory. 100If the value is t, EDE may search in any directory.
101 101
102If the value is a function, EDE calls that function with one 102If the value is a function, EDE calls that function with one
103argument, the directory name; the function should return t iff 103argument, the directory name; the function should return t if
104EDE should look for project files in the directory. 104EDE should look for project files in the directory.
105 105
106Otherwise, the value should be a list of fully-expanded directory 106Otherwise, the value should be a list of fully-expanded directory
@@ -704,7 +704,7 @@ Otherwise, create a new project for DIR."
704 "Check if DIR should be in `ede-project-directories'. 704 "Check if DIR should be in `ede-project-directories'.
705If it is not, try asking the user if it should be added; if so, 705If it is not, try asking the user if it should be added; if so,
706add it and save `ede-project-directories' via Customize. 706add it and save `ede-project-directories' via Customize.
707Return nil iff DIR should not be in `ede-project-directories'." 707Return nil if DIR should not be in `ede-project-directories'."
708 (setq dir (directory-file-name (expand-file-name dir))) ; strip trailing / 708 (setq dir (directory-file-name (expand-file-name dir))) ; strip trailing /
709 (or (eq ede-project-directories t) 709 (or (eq ede-project-directories t)
710 (and (functionp ede-project-directories) 710 (and (functionp ede-project-directories)
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index e4f239b14a9..e9715cc1bb0 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -1594,7 +1594,7 @@ Optional PARENT and COLOR as specified with
1594 "Return non-nil if TAG is considered abstract. 1594 "Return non-nil if TAG is considered abstract.
1595PARENT is tag's parent. 1595PARENT is tag's parent.
1596In C, a method is abstract if it is `virtual', which is already 1596In C, a method is abstract if it is `virtual', which is already
1597handled. A class is abstract iff its destructor is virtual." 1597handled. A class is abstract only if its destructor is virtual."
1598 (cond 1598 (cond
1599 ((eq (semantic-tag-class tag) 'type) 1599 ((eq (semantic-tag-class tag) 'type)
1600 (require 'semantic/find) 1600 (require 'semantic/find)
diff --git a/lisp/cedet/semantic/ia-sb.el b/lisp/cedet/semantic/ia-sb.el
index f77760c4452..006e8e8259f 100644
--- a/lisp/cedet/semantic/ia-sb.el
+++ b/lisp/cedet/semantic/ia-sb.el
@@ -1,7 +1,6 @@
1;;; semantic/ia-sb.el --- Speedbar analysis display interactor 1;;; semantic/ia-sb.el --- Speedbar analysis display interactor
2 2
3;;; Copyright (C) 2002-2004, 2006, 2008-2014 Free Software Foundation, 3;;; Copyright (C) 2002-2004, 2006, 2008-2014 Free Software Foundation, Inc.
4;;; Inc.
5 4
6;; Author: Eric M. Ludlam <zappo@gnu.org> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
7;; Keywords: syntax 6;; Keywords: syntax
@@ -139,7 +138,7 @@ DIRECTORY is the current directory, which is ignored, and ZERO is 0."
139 ))) 138 )))
140 139
141(defmethod semantic-ia-sb-show-doc ((context semantic-analyze-context)) 140(defmethod semantic-ia-sb-show-doc ((context semantic-analyze-context))
142 "Show documentation about CONTEXT iff CONTEXT points at a complete symbol." 141 "Show documentation about CONTEXT if CONTEXT points at a complete symbol."
143 (let ((sym (car (reverse (oref context prefix)))) 142 (let ((sym (car (reverse (oref context prefix))))
144 (doc nil)) 143 (doc nil))
145 (when (semantic-tag-p sym) 144 (when (semantic-tag-p sym)
diff --git a/lisp/cedet/semantic/tag.el b/lisp/cedet/semantic/tag.el
index 97fa607f9ae..31354846ec0 100644
--- a/lisp/cedet/semantic/tag.el
+++ b/lisp/cedet/semantic/tag.el
@@ -172,7 +172,7 @@ That function is for internal use only."
172 (semantic--tag-set-overlay tag (vector start end))))) 172 (semantic--tag-set-overlay tag (vector start end)))))
173 173
174(defun semantic-tag-in-buffer-p (tag) 174(defun semantic-tag-in-buffer-p (tag)
175 "Return the buffer TAG resides in IFF tag is already in a buffer. 175 "Return the buffer TAG resides in, if tag is already in a buffer.
176If a tag is not in a buffer, return nil." 176If a tag is not in a buffer, return nil."
177 (let ((o (semantic-tag-overlay tag))) 177 (let ((o (semantic-tag-overlay tag)))
178 ;; TAG is currently linked to a buffer, return it. 178 ;; TAG is currently linked to a buffer, return it.
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 58c3638b58b..14e4d2da0c8 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2928,7 +2928,7 @@ The function's arguments should be treated as immutable.
2928(defmacro cl-deftype (name arglist &rest body) 2928(defmacro cl-deftype (name arglist &rest body)
2929 "Define NAME as a new data type. 2929 "Define NAME as a new data type.
2930The type name can then be used in `cl-typecase', `cl-check-type', etc." 2930The type name can then be used in `cl-typecase', `cl-check-type', etc."
2931 (declare (debug cl-defmacro) (doc-string 3)) 2931 (declare (debug cl-defmacro) (doc-string 3) (indent 2))
2932 `(cl-eval-when (compile load eval) 2932 `(cl-eval-when (compile load eval)
2933 (put ',name 'cl-deftype-handler 2933 (put ',name 'cl-deftype-handler
2934 (cl-function (lambda (&cl-defs '('*) ,@arglist) ,@body))))) 2934 (cl-function (lambda (&cl-defs '('*) ,@arglist) ,@body)))))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 5158fa4c6e6..759a49a91f7 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
12014-05-04 Glenn Morris <rgm@gnu.org>
2
3 * gnus-registry.el (gnus-registry-install-p): Doc fix.
4
12014-05-02 Katsumi Yamaoka <yamaoka@jpl.org> 52014-05-02 Katsumi Yamaoka <yamaoka@jpl.org>
2 6
3 * gnus-art.el (gnus-mime-inline-part): Redisplay a button so as to show 7 * gnus-art.el (gnus-mime-inline-part): Redisplay a button so as to show
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index 5989b8885bc..f3b81f77b50 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -1125,9 +1125,9 @@ only the last one's marks are returned."
1125(add-hook 'gnus-registry-unload-hook 'gnus-registry-unload-hook) 1125(add-hook 'gnus-registry-unload-hook 'gnus-registry-unload-hook)
1126 1126
1127(defun gnus-registry-install-p () 1127(defun gnus-registry-install-p ()
1128 "If the registry is not already enabled, and `gnus-registry-install' is t, 1128 "Return non-nil if the registry is enabled (and maybe enable it first).
1129the registry is enabled. If `gnus-registry-install' is `ask', 1129If the registry is not already enabled, then if `gnus-registry-install'
1130the user is asked first. Returns non-nil iff the registry is enabled." 1130is `ask', ask the user; or if `gnus-registry-install' is non-nil, enable it."
1131 (interactive) 1131 (interactive)
1132 (unless gnus-registry-enabled 1132 (unless gnus-registry-enabled
1133 (when (if (eq gnus-registry-install 'ask) 1133 (when (if (eq gnus-registry-install 'ask)
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 2243cf29a87..af08d0f3d3a 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -473,8 +473,8 @@ message."
473 (widen) 473 (widen)
474 (goto-char (point-min)) 474 (goto-char (point-min))
475 (while (>= total msgnum) 475 (while (>= total msgnum)
476 ;; Go back to the Rmail buffer so 476 ;; Go back to the Rmail buffer so FUNCTION and
477 ;; so FUNCTION and rmail-get-summary can see its local vars. 477 ;; rmail-get-summary can see its local vars.
478 (with-current-buffer main-buffer 478 (with-current-buffer main-buffer
479 ;; First test whether to include this message. 479 ;; First test whether to include this message.
480 (if (or (null function) 480 (if (or (null function)
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 84df6922749..436d8f611a8 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -922,7 +922,7 @@ by \"Save Options\" in Custom buffers.")
922 (selected-frame))) 922 (selected-frame)))
923 923
924(defun menu-bar-positive-p (val) 924(defun menu-bar-positive-p (val)
925 "Return non-nil iff VAL is a positive number." 925 "Return non-nil if VAL is a positive number."
926 (and (numberp val) 926 (and (numberp val)
927 (> val 0))) 927 (> val 0)))
928 928
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 8e84a2fd307..cec0eb21b38 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2773,7 +2773,7 @@ expression (not containing character ranges like `a-z')."
2773 2773
2774(defcustom completion-pcm-complete-word-inserts-delimiters nil 2774(defcustom completion-pcm-complete-word-inserts-delimiters nil
2775 "Treat the SPC or - inserted by `minibuffer-complete-word' as delimiters. 2775 "Treat the SPC or - inserted by `minibuffer-complete-word' as delimiters.
2776Those chars are treated as delimiters iff this variable is non-nil. 2776Those chars are treated as delimiters if this variable is non-nil.
2777I.e. if non-nil, M-x SPC will just insert a \"-\" in the minibuffer, whereas 2777I.e. if non-nil, M-x SPC will just insert a \"-\" in the minibuffer, whereas
2778if nil, it will list all possible commands in *Completions* because none of 2778if nil, it will list all possible commands in *Completions* because none of
2779the commands start with a \"-\" or a SPC." 2779the commands start with a \"-\" or a SPC."
diff --git a/lisp/mpc.el b/lisp/mpc.el
index d89231e81b9..d569610a615 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -1811,9 +1811,14 @@ A value of t means the main playlist.")
1811 (char-after (posn-point posn)))) 1811 (char-after (posn-point posn))))
1812 '(?◁ ?<)) 1812 '(?◁ ?<))
1813 (- mpc-volume-step) mpc-volume-step)) 1813 (- mpc-volume-step) mpc-volume-step))
1814 (newvol (+ (string-to-number (cdr (assq 'volume mpc-status))) diff))) 1814 (curvol (string-to-number (cdr (assq 'volume mpc-status))))
1815 (mpc-proc-cmd (list "setvol" newvol) 'mpc-status-refresh) 1815 (newvol (max 0 (min 100 (+ curvol diff)))))
1816 (message "Set MPD volume to %s%%" newvol))) 1816 (if (= newvol curvol)
1817 (progn
1818 (message "MPD volume already at %s%%" newvol)
1819 (ding))
1820 (mpc-proc-cmd (list "setvol" newvol) 'mpc-status-refresh)
1821 (message "Set MPD volume to %s%%" newvol))))
1817 1822
1818(defun mpc-volume-widget (vol &optional size) 1823(defun mpc-volume-widget (vol &optional size)
1819 (unless size (setq size 12.5)) 1824 (unless size (setq size 12.5))
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 7f8c483ee5c..0c81a8506c0 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1979,7 +1979,7 @@ OFFSET is the position in STR at which the comparison takes place."
1979 (string-equal match (substring str offset (+ offset match-length)))))) 1979 (string-equal match (substring str offset (+ offset match-length))))))
1980 1980
1981(defun gdbmi-same-start (str offset match) 1981(defun gdbmi-same-start (str offset match)
1982 "Return non-nil iff STR and MATCH are equal up to the end of either strings. 1982 "Return non-nil if STR and MATCH are equal up to the end of either strings.
1983OFFSET is the position in STR at which the comparison takes place." 1983OFFSET is the position in STR at which the comparison takes place."
1984 (let* ((str-length (- (length str) offset)) 1984 (let* ((str-length (- (length str) offset))
1985 (match-length (length match)) 1985 (match-length (length match))
@@ -1989,7 +1989,7 @@ OFFSET is the position in STR at which the comparison takes place."
1989 (substring match 0 compare-length))))) 1989 (substring match 0 compare-length)))))
1990 1990
1991(defun gdbmi-is-number (character) 1991(defun gdbmi-is-number (character)
1992 "Return non-nil iff CHARACTER is a numerical character between 0 and 9." 1992 "Return non-nil if CHARACTER is a numerical character between 0 and 9."
1993 (and (>= character ?0) 1993 (and (>= character ?0)
1994 (<= character ?9))) 1994 (<= character ?9)))
1995 1995
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index cc9ee8fe67b..5be1373213e 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1302,7 +1302,7 @@ LIMIT defaults to point."
1302 (up-list -1))) 1302 (up-list -1)))
1303 1303
1304(defun js--inside-param-list-p () 1304(defun js--inside-param-list-p ()
1305 "Return non-nil iff point is in a function parameter list." 1305 "Return non-nil if point is in a function parameter list."
1306 (ignore-errors 1306 (ignore-errors
1307 (save-excursion 1307 (save-excursion
1308 (js--up-nearby-list) 1308 (js--up-nearby-list)
@@ -1313,7 +1313,7 @@ LIMIT defaults to point."
1313 (looking-at "function")))))))) 1313 (looking-at "function"))))))))
1314 1314
1315(defun js--inside-dojo-class-list-p () 1315(defun js--inside-dojo-class-list-p ()
1316 "Return non-nil iff point is in a Dojo multiple-inheritance class block." 1316 "Return non-nil if point is in a Dojo multiple-inheritance class block."
1317 (ignore-errors 1317 (ignore-errors
1318 (save-excursion 1318 (save-excursion
1319 (js--up-nearby-list) 1319 (js--up-nearby-list)
@@ -1352,7 +1352,7 @@ REGEXPS, but only if FRAMEWORK is in `js-enabled-frameworks'."
1352(defun js--forward-destructuring-spec (&optional func) 1352(defun js--forward-destructuring-spec (&optional func)
1353 "Move forward over a JavaScript destructuring spec. 1353 "Move forward over a JavaScript destructuring spec.
1354If FUNC is supplied, call it with no arguments before every 1354If FUNC is supplied, call it with no arguments before every
1355variable name in the spec. Return true iff this was actually a 1355variable name in the spec. Return true if this was actually a
1356spec. FUNC must preserve the match data." 1356spec. FUNC must preserve the match data."
1357 (pcase (char-after) 1357 (pcase (char-after)
1358 (?\[ 1358 (?\[
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index d82eea05e1c..bcac59a3ade 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -3228,7 +3228,7 @@ PREFIX is the prefix of the search regexp."
3228 3228
3229(unless (fboundp 'region-exists-p) 3229(unless (fboundp 'region-exists-p)
3230 (defun region-exists-p () 3230 (defun region-exists-p ()
3231 "Non-nil iff the mark is set. Lobotomized version for Emacsen that do not provide their own." 3231 "Non-nil if the mark is set. Lobotomized version for Emacsen that do not provide their own."
3232 (mark))) 3232 (mark)))
3233 3233
3234 3234
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index e8a4d925065..3ff4f57b887 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2361,7 +2361,7 @@ the value thus obtained, and the result is used instead."
2361 2361
2362;; I commented this out because nobody calls it -- rms. 2362;; I commented this out because nobody calls it -- rms.
2363;;(defun sh-abbrevs (ancestor &rest list) 2363;;(defun sh-abbrevs (ancestor &rest list)
2364;; "Iff it isn't, define the current shell as abbrev table and fill that. 2364;; "If it isn't, define the current shell as abbrev table and fill that.
2365;;Abbrev table will inherit all abbrevs from ANCESTOR, which is either an abbrev 2365;;Abbrev table will inherit all abbrevs from ANCESTOR, which is either an abbrev
2366;;table or a list of (NAME1 EXPANSION1 ...). In addition it will define abbrevs 2366;;table or a list of (NAME1 EXPANSION1 ...). In addition it will define abbrevs
2367;;according to the remaining arguments NAMEi EXPANSIONi ... 2367;;according to the remaining arguments NAMEi EXPANSIONi ...
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index b07e2ba5203..d0f8897ed65 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -3160,7 +3160,7 @@ and `verilog-scan'.")
3160 (setq verilog-scan-cache-tick nil)) 3160 (setq verilog-scan-cache-tick nil))
3161 3161
3162(defun verilog-scan-cache-ok-p () 3162(defun verilog-scan-cache-ok-p ()
3163 "Return t iff the scan cache is up to date." 3163 "Return t if the scan cache is up to date."
3164 (or (and verilog-scan-cache-preserving 3164 (or (and verilog-scan-cache-preserving
3165 (eq verilog-scan-cache-preserving (current-buffer)) 3165 (eq verilog-scan-cache-preserving (current-buffer))
3166 verilog-scan-cache-tick) 3166 verilog-scan-cache-tick)
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 25bce076cbc..5b0433475b6 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -357,7 +357,7 @@ of master file."
357 docstruct)) 357 docstruct))
358 358
359(defun reftex-using-biblatex-p () 359(defun reftex-using-biblatex-p ()
360 "Return non-nil iff we are using biblatex rather than bibtex." 360 "Return non-nil if we are using biblatex rather than bibtex."
361 (if (boundp 'TeX-active-styles) 361 (if (boundp 'TeX-active-styles)
362 ;; the sophisticated AUCTeX way 362 ;; the sophisticated AUCTeX way
363 (member "biblatex" TeX-active-styles) 363 (member "biblatex" TeX-active-styles)
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 486c6649c00..f3426656038 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,7 @@
12014-05-04 Glenn Morris <rgm@gnu.org>
2
3 * url-parse.el (url-generic-parse-url): Doc fix (replace `iff').
4
12014-04-01 Michael Albinus <michael.albinus@gmx.de> 52014-04-01 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * url-tramp.el: New file. 7 * url-tramp.el: New file.
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index 50de84f5167..0a811297986 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -125,7 +125,7 @@ TARGET is the fragment identifier component (used to refer to a
125ATTRIBUTES is nil; this slot originally stored the attribute and 125ATTRIBUTES is nil; this slot originally stored the attribute and
126 value alists for IMAP URIs, but this feature was removed 126 value alists for IMAP URIs, but this feature was removed
127 since it conflicts with RFC 3986. 127 since it conflicts with RFC 3986.
128FULLNESS is non-nil iff the hierarchical sequence component of 128FULLNESS is non-nil if the hierarchical sequence component of
129 the URL starts with two slashes, \"//\". 129 the URL starts with two slashes, \"//\".
130 130
131The parser follows RFC 3986, except that it also tries to handle 131The parser follows RFC 3986, except that it also tries to handle
diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el
index ed248fbf835..d21b4cc6d0b 100644
--- a/lisp/vc/ediff-diff.el
+++ b/lisp/vc/ediff-diff.el
@@ -818,10 +818,9 @@ one optional arguments, diff-number to refine.")
818 n &optional default) 818 n &optional default)
819 (let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type)) 819 (let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type))
820 (face (if default 820 (face (if default
821 'default 821 nil
822 (ediff-get-symbol-from-alist 822 (ediff-get-symbol-from-alist
823 buf-type ediff-fine-diff-face-alist) 823 buf-type ediff-fine-diff-face-alist))))
824 )))
825 (mapc (lambda (overl) 824 (mapc (lambda (overl)
826 (ediff-set-overlay-face overl face)) 825 (ediff-set-overlay-face overl face))
827 fine-diff-vector))) 826 fine-diff-vector)))
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index f3781c53885..dd0d76485bf 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -807,7 +807,7 @@ TYPE-OF-EMACS is either 'xemacs or 'emacs."
807 807
808(defun ediff-set-overlay-face (extent face) 808(defun ediff-set-overlay-face (extent face)
809 (ediff-overlay-put extent 'face face) 809 (ediff-overlay-put extent 'face face)
810 (ediff-overlay-put extent 'help-echo 'ediff-region-help-echo)) 810 (ediff-overlay-put extent 'help-echo (if face 'ediff-region-help-echo)))
811 811
812(defun ediff-region-help-echo (extent-or-window &optional overlay _point) 812(defun ediff-region-help-echo (extent-or-window &optional overlay _point)
813 (unless overlay 813 (unless overlay
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 649ef884059..dbf52479527 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -958,7 +958,7 @@ On a dumb terminal, switches between ASCII highlighting and no highlighting."
958 (message "Auto-refining is OFF") 958 (message "Auto-refining is OFF")
959 (setq ediff-auto-refine 'off)) 959 (setq ediff-auto-refine 'off))
960 (t ;; nix 'em 960 (t ;; nix 'em
961 (ediff-set-fine-diff-properties ediff-current-difference 'default) 961 (ediff-set-fine-diff-properties ediff-current-difference t)
962 (message "Refinements are HIDDEN") 962 (message "Refinements are HIDDEN")
963 (setq ediff-auto-refine 'nix)) 963 (setq ediff-auto-refine 'nix))
964 )) 964 ))
@@ -2973,7 +2973,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2973 )) 2973 ))
2974 2974
2975 ;; unhighlight fine diffs 2975 ;; unhighlight fine diffs
2976 (ediff-set-fine-diff-properties ediff-current-difference 'default) 2976 (ediff-set-fine-diff-properties ediff-current-difference t)
2977 (run-hooks 'ediff-unselect-hook)))) 2977 (run-hooks 'ediff-unselect-hook))))
2978 2978
2979 2979
@@ -3492,7 +3492,7 @@ Ediff Control Panel to restore highlighting."
3492 3492
3493 (if (ediff-valid-difference-p ediff-current-difference) 3493 (if (ediff-valid-difference-p ediff-current-difference)
3494 (progn 3494 (progn
3495 (ediff-set-fine-diff-properties ediff-current-difference 'default) 3495 (ediff-set-fine-diff-properties ediff-current-difference t)
3496 (ediff-unhighlight-diff))) 3496 (ediff-unhighlight-diff)))
3497 (ediff-paint-background-regions 'unhighlight) 3497 (ediff-paint-background-regions 'unhighlight)
3498 3498