aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-07-28 05:39:09 -0400
committerGlenn Morris2014-07-28 05:39:09 -0400
commitda41ffdd089b529c3d5216412d95840e065c3fe3 (patch)
treea69f5a510e2c47f774f145d9567188bc89563ac1
parent414e1537ab09d2f4571e61b420523dcd082f2d3a (diff)
parent1c6c2e3c70ff2f666a1e3f29b8852d375c8392cd (diff)
downloademacs-da41ffdd089b529c3d5216412d95840e065c3fe3.tar.gz
emacs-da41ffdd089b529c3d5216412d95840e065c3fe3.zip
Merge from emacs-24; up to 2014-06-26T06:55:15Z!rgm@gnu.org
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/todo-mode.texi9
-rw-r--r--etc/DEBUG10
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog46
-rw-r--r--lisp/calendar/todo-mode.el314
-rw-r--r--lisp/files.el1
-rw-r--r--lisp/progmodes/prolog.el4
-rw-r--r--lisp/progmodes/python.el3
-rw-r--r--lisp/textmodes/tex-mode.el2
-rw-r--r--lisp/vc/vc-hooks.el11
-rw-r--r--lisp/window.el2
-rw-r--r--src/.gdbinit10
-rw-r--r--src/ChangeLog6
-rw-r--r--src/dispnew.c2
-rw-r--r--src/window.c4
-rw-r--r--test/automated/python-tests.el2
17 files changed, 256 insertions, 177 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index d78543183df..261f81f8b2f 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12014-07-28 Stephen Berman <stephen.berman@gmx.net>
2
3 * todo-mode.texi (Marked Items): Correct omission of item deletion
4 from commands applying to both todo and done items.
5
12014-07-18 Albert Krewinkel <albert+gnus@zeitkraut.de> 62014-07-18 Albert Krewinkel <albert+gnus@zeitkraut.de>
2 7
3 * gnus.texi (Posting Styles): Document the possibility to perform 8 * gnus.texi (Posting Styles): Document the possibility to perform
diff --git a/doc/misc/todo-mode.texi b/doc/misc/todo-mode.texi
index bb2aea21ac2..8b9903419ab 100644
--- a/doc/misc/todo-mode.texi
+++ b/doc/misc/todo-mode.texi
@@ -1323,10 +1323,11 @@ If you use @kbd{m}, @kbd{d}, @kbd{A d} or @kbd{u} on multiple
1323noncontiguous marked items, the relocated items retain their relative 1323noncontiguous marked items, the relocated items retain their relative
1324order but are now listed consecutively en bloc. 1324order but are now listed consecutively en bloc.
1325 1325
1326You can mark both todo and done items, but note that only @kbd{m} can apply 1326You can mark both todo and done items, but note that only @kbd{m} and
1327to both; other commands only affect either marked todo or marked done 1327@kbd{k} can apply to both; other commands only affect either marked
1328items, so if both types of items are marked, invoking these commands 1328todo or marked done items, so if both types of items are marked,
1329has no effect and informs you of your erroneous attempt. 1329invoking these commands has no effect and informs you of your
1330erroneous attempt.
1330 1331
1331@node Todo Categories Mode, Searching for Items, Marked Items, Top 1332@node Todo Categories Mode, Searching for Items, Marked Items, Top
1332@chapter Todo Categories Mode 1333@chapter Todo Categories Mode
diff --git a/etc/DEBUG b/etc/DEBUG
index c1b04eaf7f2..096bdbc48c9 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -7,9 +7,9 @@ See the end of the file for license conditions.
7[People who debug Emacs on Windows using Microsoft debuggers should 7[People who debug Emacs on Windows using Microsoft debuggers should
8read the Windows-specific section near the end of this document.] 8read the Windows-specific section near the end of this document.]
9 9
10** When you debug Emacs with GDB, you should start it in the directory 10** When you debug Emacs with GDB, you should start GDB in the directory
11where the executable was made (the 'src' directory in the Emacs source 11where the Emacs executable was made (the 'src' directory in the Emacs
12tree). That directory has a .gdbinit file that defines various 12source tree). That directory has a .gdbinit file that defines various
13"user-defined" commands for debugging Emacs. (These commands are 13"user-defined" commands for debugging Emacs. (These commands are
14described below under "Examining Lisp object values" and "Debugging 14described below under "Examining Lisp object values" and "Debugging
15Emacs Redisplay problems".) 15Emacs Redisplay problems".)
@@ -21,7 +21,9 @@ you will see a warning when GDB starts, like this:
21 warning: File ".../src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". 21 warning: File ".../src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
22 22
23There are several ways to overcome that difficulty, they are all 23There are several ways to overcome that difficulty, they are all
24described in the node "Auto-loading safe path" in the GDB user manual. 24described in the node "Auto-loading safe path" in the GDB user
25manual. If nothing else helps, type "source /path/to/.gdbinit RET" at
26the GDB prompt, to unconditionally load the GDB init file.
25 27
26** When you are trying to analyze failed assertions or backtraces, it 28** When you are trying to analyze failed assertions or backtraces, it
27is essential to compile Emacs with flags suitable for debugging. 29is essential to compile Emacs with flags suitable for debugging.
diff --git a/etc/NEWS b/etc/NEWS
index 558e1608dfb..9a2c03aad15 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -873,7 +873,7 @@ along with the non-SMIE indentation code.
873** Python mode 873** Python mode
874 874
875*** Out of the box support for CPython, iPython and readline based shells. 875*** Out of the box support for CPython, iPython and readline based shells.
876**** `python-shell-completion-module-string-code` is no longer used. 876**** `python-shell-completion-module-string-code' is no longer used.
877 877
878*** Automatic shell prompt detection. New user options: 878*** Automatic shell prompt detection. New user options:
879**** `python-shell-interpreter-interactive-arg'. 879**** `python-shell-interpreter-interactive-arg'.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 23e66fe3158..1d00a180e9c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,49 @@
12014-07-28 Eli Zaretskii <eliz@gnu.org>
2
3 * window.el (window--pixel-to-total): Use FRAME's root window, not
4 that of the selected frame. (Bug#18112, Bug#16674)
5
62014-07-28 Andreas Schwab <schwab@linux-m68k.org>
7
8 * textmodes/tex-mode.el (tex-font-lock-verb): Doc fix.
9 (Bug#18117)
10
112014-07-28 Fabián Ezequiel Gallina <fgallina@gnu.org>
12
13 * progmodes/python.el (inferior-python-mode): Doc fix.
14
152014-07-28 Stephen Berman <stephen.berman@gmx.net>
16
17 * calendar/todo-mode.el (todo-edit-item--next-key): If next key is
18 not a character, ignore it instead of raising an error.
19
20 * calendar/todo-mode.el: Fix handling of marked items and make
21 minor code improvements.
22 (todo-edit-item): If there are marked items, ensure user can only
23 invoke editing commands that work with marked items.
24 (todo-edit-item--text): When there are marked items, make it a
25 noop if invoked with point not on an item; otherwise, ensure it
26 applies only to item at point.
27 (todo-item-undone): If there are marked not-done items, return
28 point to its original position before signaling user error.
29 (todo--user-error-if-marked-done-item): New function.
30 (todo-edit-item--header, todo-edit-item--diary-inclusion)
31 (todo-item-done): Use it.
32
332014-07-28 Glenn Morris <rgm@gnu.org>
34
35 * files.el (toggle-read-only): Re-add basic doc-string.
36 * vc/vc-hooks.el (vc-toggle-read-only): Tweak obsolescence mesage.
37
38 * progmodes/prolog.el (prolog-mode-keybindings-edit):
39 Replace missing `switch-to-prolog' with `run-prolog'.
40 (switch-to-prolog): Define as (obsolete) alias, as in 23.4.
41
422014-07-28 Stephen Berman <stephen.berman@gmx.net>
43
44 * calendar/todo-mode.el (todo-set-top-priorities): Fix overwriting
45 of file-wide setting when changing category-wide setting.
46
12014-07-28 Stephen Berman <stephen.berman@gmx.net> 472014-07-28 Stephen Berman <stephen.berman@gmx.net>
2 48
3 * doc-view.el (doc-view-open-text): Don't require that the 49 * doc-view.el (doc-view-open-text): Don't require that the
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 7429819adc9..6a857a10fda 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -2068,87 +2068,101 @@ the item at point."
2068(defun todo-edit-item (&optional arg) 2068(defun todo-edit-item (&optional arg)
2069 "Choose an editing operation for the current item and carry it out." 2069 "Choose an editing operation for the current item and carry it out."
2070 (interactive "P") 2070 (interactive "P")
2071 (cond ((todo-done-item-p) 2071 (let ((marked (assoc (todo-current-category) todo-categories-with-marks)))
2072 (todo-edit-item--next-key todo-edit-done-item--param-key-alist)) 2072 (cond ((and (todo-done-item-p) (not marked))
2073 ((todo-item-string) 2073 (todo-edit-item--next-key todo-edit-done-item--param-key-alist))
2074 (todo-edit-item--next-key todo-edit-item--param-key-alist arg)))) 2074 ((or marked (todo-item-string))
2075 (todo-edit-item--next-key todo-edit-item--param-key-alist arg)))))
2075 2076
2076(defun todo-edit-item--text (&optional arg) 2077(defun todo-edit-item--text (&optional arg)
2077 "Function providing the text editing facilities of `todo-edit-item'." 2078 "Function providing the text editing facilities of `todo-edit-item'."
2078 (let* ((opoint (point)) 2079 (let ((full-item (todo-item-string)))
2079 (start (todo-item-start)) 2080 ;; If there are marked items and user invokes a text-editing
2080 (end (save-excursion (todo-item-end))) 2081 ;; commands with point not on an item, todo-item-start is nil and
2081 (item-beg (progn 2082 ;; 1+ signals an error, so just make this a noop.
2082 (re-search-forward 2083 (when full-item
2083 (concat todo-date-string-start todo-date-pattern 2084 (let* ((opoint (point))
2084 "\\( " diary-time-regexp "\\)?" 2085 (start (todo-item-start))
2085 (regexp-quote todo-nondiary-end) "?") 2086 (end (save-excursion (todo-item-end)))
2086 (line-end-position) t) 2087 (item-beg (progn
2087 (1+ (- (point) start)))) 2088 (re-search-forward
2088 (include-header (eq arg 'include-header)) 2089 (concat todo-date-string-start todo-date-pattern
2089 (comment-edit (eq arg 'comment-edit)) 2090 "\\( " diary-time-regexp "\\)?"
2090 (comment-delete (eq arg 'comment-delete)) 2091 (regexp-quote todo-nondiary-end) "?")
2091 (header-string (substring (todo-item-string) 0 item-beg)) 2092 (line-end-position) t)
2092 (item (if (or include-header comment-edit comment-delete) 2093 (1+ (- (point) start))))
2093 (todo-item-string) 2094 (include-header (eq arg 'include-header))
2094 (substring (todo-item-string) item-beg))) 2095 (comment-edit (eq arg 'comment-edit))
2095 (multiline (> (length (split-string item "\n")) 1)) 2096 (comment-delete (eq arg 'comment-delete))
2096 (comment (save-excursion 2097 (header-string (substring full-item 0 item-beg))
2097 (todo-item-start) 2098 (item (if (or include-header comment-edit comment-delete)
2098 (re-search-forward 2099 full-item
2099 (concat " \\[" (regexp-quote todo-comment-string) 2100 (substring full-item item-beg)))
2100 ": \\([^]]+\\)\\]") end t))) 2101 (multiline (or (eq arg 'multiline)
2101 (prompt (if comment "Edit comment: " "Enter a comment: ")) 2102 (> (length (split-string item "\n")) 1)))
2102 (buffer-read-only nil)) 2103 (comment (save-excursion
2103 (cond 2104 (todo-item-start)
2104 ((or comment-edit comment-delete) 2105 (re-search-forward
2105 (save-excursion 2106 (concat " \\[" (regexp-quote todo-comment-string)
2106 (todo-item-start) 2107 ": \\([^]]+\\)\\]") end t)))
2107 (if (re-search-forward (concat " \\[" (regexp-quote todo-comment-string) 2108 (prompt (if comment "Edit comment: " "Enter a comment: "))
2108 ": \\([^]]+\\)\\]") 2109 (buffer-read-only nil))
2109 end t) 2110 ;; When there are marked items, user can invoke todo-edit-item
2110 (if comment-delete 2111 ;; even if point is not on an item, but text editing only
2111 (when (todo-y-or-n-p "Delete comment? ") 2112 ;; applies to the item at point.
2112 (delete-region (match-beginning 0) (match-end 0))) 2113 (when (or (and (todo-done-item-p)
2113 (replace-match (read-string prompt (cons (match-string 1) 1)) 2114 (or comment-edit comment-delete))
2114 nil nil nil 1)) 2115 (and (not (todo-done-item-p))
2115 (if comment-delete 2116 (or (not arg) include-header multiline)))
2116 (user-error "There is no comment to delete") 2117 (cond
2117 (insert " [" todo-comment-string ": " 2118 ((or comment-edit comment-delete)
2118 (prog1 (read-string prompt) 2119 (save-excursion
2119 ;; If user moved point during editing, 2120 (todo-item-start)
2120 ;; make sure it moves back. 2121 (if (re-search-forward (concat " \\["
2121 (goto-char opoint) 2122 (regexp-quote todo-comment-string)
2122 (todo-item-end)) 2123 ": \\([^]]+\\)\\]") end t)
2123 "]"))))) 2124 (if comment-delete
2124 ((or multiline (eq arg 'multiline)) 2125 (when (todo-y-or-n-p "Delete comment? ")
2125 (let ((buf todo-edit-buffer)) 2126 (delete-region (match-beginning 0) (match-end 0)))
2126 (set-window-buffer (selected-window) 2127 (replace-match (read-string prompt (cons (match-string 1) 1))
2127 (set-buffer (make-indirect-buffer (buffer-name) buf))) 2128 nil nil nil 1))
2128 (narrow-to-region (todo-item-start) (todo-item-end)) 2129 (if comment-delete
2129 (todo-edit-mode) 2130 (user-error "There is no comment to delete")
2130 (message "%s" (substitute-command-keys 2131 (insert " [" todo-comment-string ": "
2131 (concat "Type \\[todo-edit-quit] " 2132 (prog1 (read-string prompt)
2132 "to return to Todo mode.\n"))))) 2133 ;; If user moved point during editing,
2133 (t 2134 ;; make sure it moves back.
2134 (let ((new (concat (if include-header "" header-string) 2135 (goto-char opoint)
2135 (read-string "Edit: " (if include-header 2136 (todo-item-end))
2136 (cons item item-beg) 2137 "]")))))
2137 (cons item 0)))))) 2138 (multiline
2138 (when include-header 2139 (let ((buf todo-edit-buffer))
2139 (while (not (string-match (concat todo-date-string-start 2140 (set-window-buffer (selected-window)
2140 todo-date-pattern) 2141 (set-buffer (make-indirect-buffer
2141 new)) 2142 (buffer-name) buf)))
2142 (setq new (read-from-minibuffer 2143 (narrow-to-region (todo-item-start) (todo-item-end))
2143 "Item must start with a date: " new)))) 2144 (todo-edit-mode)
2144 ;; Ensure lines following hard newlines are indented. 2145 (message "%s" (substitute-command-keys
2145 (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]" 2146 (concat "Type \\[todo-edit-quit] "
2146 "\n\t" new nil nil 1)) 2147 "to return to Todo mode.\n")))))
2147 ;; If user moved point during editing, make sure it moves back. 2148 (t
2148 (goto-char opoint) 2149 (let ((new (concat (if include-header "" header-string)
2149 (todo-remove-item) 2150 (read-string "Edit: " (if include-header
2150 (todo-insert-with-overlays new) 2151 (cons item item-beg)
2151 (move-to-column item-beg)))))) 2152 (cons item 0))))))
2153 (when include-header
2154 (while (not (string-match (concat todo-date-string-start
2155 todo-date-pattern) new))
2156 (setq new (read-from-minibuffer
2157 "Item must start with a date: " new))))
2158 ;; Ensure lines following hard newlines are indented.
2159 (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
2160 "\n\t" new nil nil 1))
2161 ;; If user moved point during editing, make sure it moves back.
2162 (goto-char opoint)
2163 (todo-remove-item)
2164 (todo-insert-with-overlays new)
2165 (move-to-column item-beg)))))))))
2152 2166
2153(defun todo-edit-quit () 2167(defun todo-edit-quit ()
2154 "Return from Todo Edit mode to Todo mode. 2168 "Return from Todo Edit mode to Todo mode.
@@ -2203,16 +2217,16 @@ made in the number or names of categories."
2203 2217
2204(defun todo-edit-item--header (what &optional inc) 2218(defun todo-edit-item--header (what &optional inc)
2205 "Function providing header editing facilities of `todo-edit-item'." 2219 "Function providing header editing facilities of `todo-edit-item'."
2206 (let* ((cat (todo-current-category)) 2220 (let ((marked (assoc (todo-current-category) todo-categories-with-marks))
2207 (marked (assoc cat todo-categories-with-marks)) 2221 (first t)
2208 (first t) 2222 (todo-date-from-calendar t)
2209 (todo-date-from-calendar t) 2223 ;; INC must be an integer, but users could pass it via
2210 ;; INC must be an integer, but users could pass it via 2224 ;; `todo-edit-item' as e.g. `-' or `C-u'.
2211 ;; `todo-edit-item' as e.g. `-' or `C-u'. 2225 (inc (prefix-numeric-value inc))
2212 (inc (prefix-numeric-value inc)) 2226 (buffer-read-only nil)
2213 (buffer-read-only nil) 2227 ndate ntime year monthname month day
2214 ndate ntime year monthname month day 2228 dayname) ; Needed by calendar-date-display-form.
2215 dayname) ; Needed by calendar-date-display-form. 2229 (when marked (todo--user-error-if-marked-done-item))
2216 (save-excursion 2230 (save-excursion
2217 (or (and marked (goto-char (point-min))) (todo-item-start)) 2231 (or (and marked (goto-char (point-min))) (todo-item-start))
2218 (catch 'end 2232 (catch 'end
@@ -2374,47 +2388,45 @@ made in the number or names of categories."
2374(defun todo-edit-item--diary-inclusion (&optional nonmarking) 2388(defun todo-edit-item--diary-inclusion (&optional nonmarking)
2375 "Function providing diary marking facilities of `todo-edit-item'." 2389 "Function providing diary marking facilities of `todo-edit-item'."
2376 (let ((buffer-read-only) 2390 (let ((buffer-read-only)
2377 (marked (assoc (todo-current-category) 2391 (marked (assoc (todo-current-category) todo-categories-with-marks)))
2378 todo-categories-with-marks))) 2392 (when marked (todo--user-error-if-marked-done-item))
2379 (catch 'stop 2393 (catch 'stop
2380 (save-excursion 2394 (save-excursion
2381 (when marked (goto-char (point-min))) 2395 (when marked (goto-char (point-min)))
2382 (while (not (eobp)) 2396 (while (not (eobp))
2383 (if (todo-done-item-p) 2397 (unless (and marked (not (todo-marked-item-p)))
2384 (throw 'stop (message "Done items cannot be edited")) 2398 (let* ((beg (todo-item-start))
2385 (unless (and marked (not (todo-marked-item-p))) 2399 (lim (save-excursion (todo-item-end)))
2386 (let* ((beg (todo-item-start)) 2400 (end (save-excursion
2387 (lim (save-excursion (todo-item-end))) 2401 (or (todo-time-string-matcher lim)
2388 (end (save-excursion 2402 (todo-date-string-matcher lim)))))
2389 (or (todo-time-string-matcher lim) 2403 (if nonmarking
2390 (todo-date-string-matcher lim))))) 2404 (if (looking-at (regexp-quote diary-nonmarking-symbol))
2391 (if nonmarking 2405 (replace-match "")
2392 (if (looking-at (regexp-quote diary-nonmarking-symbol)) 2406 (when (looking-at (regexp-quote todo-nondiary-start))
2393 (replace-match "") 2407 (save-excursion
2394 (when (looking-at (regexp-quote todo-nondiary-start))
2395 (save-excursion
2396 (replace-match "")
2397 (search-forward todo-nondiary-end (1+ end) t)
2398 (replace-match "")
2399 (todo-update-count 'diary 1)))
2400 (insert diary-nonmarking-symbol))
2401 (if (looking-at (regexp-quote todo-nondiary-start))
2402 (progn
2403 (replace-match "") 2408 (replace-match "")
2404 (search-forward todo-nondiary-end (1+ end) t) 2409 (search-forward todo-nondiary-end (1+ end) t)
2405 (replace-match "") 2410 (replace-match "")
2406 (todo-update-count 'diary 1)) 2411 (todo-update-count 'diary 1)))
2407 (when end 2412 (insert diary-nonmarking-symbol))
2408 (when (looking-at (regexp-quote diary-nonmarking-symbol)) 2413 (if (looking-at (regexp-quote todo-nondiary-start))
2409 (replace-match "") 2414 (progn
2410 (setq end (1- end))) ; Since we deleted nonmarking symbol. 2415 (replace-match "")
2411 (insert todo-nondiary-start) 2416 (search-forward todo-nondiary-end (1+ end) t)
2412 (goto-char (1+ end)) 2417 (replace-match "")
2413 (insert todo-nondiary-end) 2418 (todo-update-count 'diary 1))
2414 (todo-update-count 'diary -1)))))) 2419 (when end
2415 (unless marked (throw 'stop nil)) 2420 (when (looking-at (regexp-quote diary-nonmarking-symbol))
2416 (todo-forward-item))))) 2421 (replace-match "")
2417 (todo-update-categories-sexp))) 2422 (setq end (1- end))) ; Since we deleted nonmarking symbol.
2423 (insert todo-nondiary-start)
2424 (goto-char (1+ end))
2425 (insert todo-nondiary-end)
2426 (todo-update-count 'diary -1))))))
2427 (unless marked (throw 'stop nil))
2428 (todo-forward-item)))))
2429 (todo-update-categories-sexp))
2418 2430
2419(defun todo-edit-category-diary-inclusion (arg) 2431(defun todo-edit-category-diary-inclusion (arg)
2420 "Make all items in this category diary items. 2432 "Make all items in this category diary items.
@@ -2785,21 +2797,7 @@ visible."
2785 (interactive "P") 2797 (interactive "P")
2786 (let* ((cat (todo-current-category)) 2798 (let* ((cat (todo-current-category))
2787 (marked (assoc cat todo-categories-with-marks))) 2799 (marked (assoc cat todo-categories-with-marks)))
2788 (when marked 2800 (when marked (todo--user-error-if-marked-done-item))
2789 (save-excursion
2790 (save-restriction
2791 (goto-char (point-max))
2792 (todo-backward-item)
2793 (unless (todo-done-item-p)
2794 (widen)
2795 (unless (re-search-forward
2796 (concat "^" (regexp-quote todo-category-beg)) nil t)
2797 (goto-char (point-max)))
2798 (forward-line -1))
2799 (while (todo-done-item-p)
2800 (when (todo-marked-item-p)
2801 (user-error "This command does not apply to done items"))
2802 (todo-backward-item)))))
2803 (unless (and (not marked) 2801 (unless (and (not marked)
2804 (or (todo-done-item-p) 2802 (or (todo-done-item-p)
2805 ;; Point is between todo and done items. 2803 ;; Point is between todo and done items.
@@ -2887,7 +2885,9 @@ comments without asking."
2887 (while (not (eobp)) 2885 (while (not (eobp))
2888 (when (or (not marked) (and marked (todo-marked-item-p))) 2886 (when (or (not marked) (and marked (todo-marked-item-p)))
2889 (if (not (todo-done-item-p)) 2887 (if (not (todo-done-item-p))
2890 (user-error "Only done items can be undone") 2888 (progn
2889 (goto-char opoint)
2890 (user-error "Only done items can be undone"))
2891 (todo-item-start) 2891 (todo-item-start)
2892 (unless marked 2892 (unless marked
2893 (setq ov (make-overlay (save-excursion (todo-item-start)) 2893 (setq ov (make-overlay (save-excursion (todo-item-start))
@@ -4285,24 +4285,25 @@ set the user customizable option `todo-top-priorities-overrides'."
4285 (frule (assoc-string file rules)) 4285 (frule (assoc-string file rules))
4286 (crules (nth 2 frule)) 4286 (crules (nth 2 frule))
4287 (crule (assoc-string cat crules)) 4287 (crule (assoc-string cat crules))
4288 (cur (or (and arg (cdr crule)) 4288 (fcur (or (nth 1 frule)
4289 (nth 1 frule) 4289 todo-top-priorities))
4290 todo-top-priorities)) 4290 (ccur (or (and arg (cdr crule))
4291 fcur))
4291 (prompt (if arg (concat "Number of top priorities in this category" 4292 (prompt (if arg (concat "Number of top priorities in this category"
4292 " (currently %d): ") 4293 " (currently %d): ")
4293 (concat "Default number of top priorities per category" 4294 (concat "Default number of top priorities per category"
4294 " in this file (currently %d): "))) 4295 " in this file (currently %d): ")))
4295 (new -1)) 4296 (new -1))
4296 (while (< new 0) 4297 (while (< new 0)
4297 (let ((cur0 cur)) 4298 (let ((cur (if arg ccur fcur)))
4298 (setq new (read-number (format prompt cur0)) 4299 (setq new (read-number (format prompt cur))
4299 prompt "Enter a non-negative number: " 4300 prompt "Enter a non-negative number: "
4300 cur0 nil))) 4301 cur nil)))
4301 (let ((nrule (if arg 4302 (let ((nrule (if arg
4302 (append (delete crule crules) (list (cons cat new))) 4303 (append (delete crule crules) (list (cons cat new)))
4303 (append (list file new) (list crules))))) 4304 (append (list file new) (list crules)))))
4304 (setq rules (cons (if arg 4305 (setq rules (cons (if arg
4305 (list file cur nrule) 4306 (list file fcur nrule)
4306 nrule) 4307 nrule)
4307 (delete frule rules))) 4308 (delete frule rules)))
4308 (customize-save-variable 'todo-top-priorities-overrides rules) 4309 (customize-save-variable 'todo-top-priorities-overrides rules)
@@ -5223,6 +5224,25 @@ Overrides `diary-goto-entry'."
5223 (progn (goto-char (point-min)) 5224 (progn (goto-char (point-min))
5224 (looking-at todo-done-string-start))))) 5225 (looking-at todo-done-string-start)))))
5225 5226
5227(defun todo--user-error-if-marked-done-item ()
5228 "Signal user error on marked done items.
5229Helper funtion for editing commands that only apply to (possibly
5230marked) not done todo items."
5231 (save-excursion
5232 (save-restriction
5233 (goto-char (point-max))
5234 (todo-backward-item)
5235 (unless (todo-done-item-p)
5236 (widen)
5237 (unless (re-search-forward
5238 (concat "^" (regexp-quote todo-category-beg)) nil t)
5239 (goto-char (point-max)))
5240 (forward-line -1))
5241 (while (todo-done-item-p)
5242 (when (todo-marked-item-p)
5243 (user-error "This command does not apply to done items"))
5244 (todo-backward-item)))))
5245
5226(defun todo-reset-done-separator (sep) 5246(defun todo-reset-done-separator (sep)
5227 "Replace existing overlays of done items separator string SEP." 5247 "Replace existing overlays of done items separator string SEP."
5228 (save-excursion 5248 (save-excursion
@@ -5531,8 +5551,8 @@ already entered and those still available."
5531 '(add/edit delete)) 5551 '(add/edit delete))
5532 " comment")))) 5552 " comment"))))
5533 params " ")) 5553 params " "))
5534 (this-key (char-to-string 5554 (this-key (let ((key (read-key (concat todo-edit-item--prompt p->k))))
5535 (read-key (concat todo-edit-item--prompt p->k)))) 5555 (and (characterp key) (char-to-string key))))
5536 (this-param (car (rassoc this-key params)))) 5556 (this-param (car (rassoc this-key params))))
5537 (pcase this-param 5557 (pcase this-param
5538 (`edit (todo-edit-item--text)) 5558 (`edit (todo-edit-item--text))
diff --git a/lisp/files.el b/lisp/files.el
index 252ae76fa0b..9272e98384f 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5017,6 +5017,7 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'."
5017 (set-buffer-modified-p arg)) 5017 (set-buffer-modified-p arg))
5018 5018
5019(defun toggle-read-only (&optional arg interactive) 5019(defun toggle-read-only (&optional arg interactive)
5020 "Change whether this buffer is read-only."
5020 (declare (obsolete read-only-mode "24.3")) 5021 (declare (obsolete read-only-mode "24.3"))
5021 (interactive (list current-prefix-arg t)) 5022 (interactive (list current-prefix-arg t))
5022 (if interactive 5023 (if interactive
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index a082d75b3c4..853f2d0dad2 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1079,7 +1079,7 @@ VERSION is of the format (Major . Minor)"
1079 ;; Inherited from the old prolog.el. 1079 ;; Inherited from the old prolog.el.
1080 (define-key map "\e\C-x" 'prolog-consult-region) 1080 (define-key map "\e\C-x" 'prolog-consult-region)
1081 (define-key map "\C-c\C-l" 'prolog-consult-file) 1081 (define-key map "\C-c\C-l" 'prolog-consult-file)
1082 (define-key map "\C-c\C-z" 'switch-to-prolog)) 1082 (define-key map "\C-c\C-z" 'run-prolog))
1083 1083
1084(defun prolog-mode-keybindings-inferior (_map) 1084(defun prolog-mode-keybindings-inferior (_map)
1085 "Define keybindings for inferior Prolog mode in MAP." 1085 "Define keybindings for inferior Prolog mode in MAP."
@@ -1240,6 +1240,8 @@ To find out what version of Prolog mode you are running, enter
1240 ((string-match "\\`[rf] *[0-9]*\\'" str) nil) ;r(edo) or f(ail) 1240 ((string-match "\\`[rf] *[0-9]*\\'" str) nil) ;r(edo) or f(ail)
1241 (t t))) 1241 (t t)))
1242 1242
1243;; This statement was missing in Emacs 24.1, 24.2, 24.3.
1244(define-obsolete-function-alias 'switch-to-prolog 'run-prolog "24.1")
1243;;;###autoload 1245;;;###autoload
1244(defun run-prolog (arg) 1246(defun run-prolog (arg)
1245 "Run an inferior Prolog process, input and output via buffer *prolog*. 1247 "Run an inferior Prolog process, input and output via buffer *prolog*.
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 7d882837abc..b08da8da029 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2332,7 +2332,6 @@ interpreter is run. Variables
2332`python-shell-font-lock-enable', 2332`python-shell-font-lock-enable',
2333`python-shell-completion-setup-code', 2333`python-shell-completion-setup-code',
2334`python-shell-completion-string-code', 2334`python-shell-completion-string-code',
2335`python-shell-completion-module-string-code',
2336`python-eldoc-setup-code', `python-eldoc-string-code', 2335`python-eldoc-setup-code', `python-eldoc-string-code',
2337`python-ffap-setup-code' and `python-ffap-string-code' can 2336`python-ffap-setup-code' and `python-ffap-string-code' can
2338customize this mode for different Python interpreters. 2337customize this mode for different Python interpreters.
@@ -2408,7 +2407,7 @@ killed."
2408 interpreter nil args)) 2407 interpreter nil args))
2409 (python-shell--parent-buffer (current-buffer)) 2408 (python-shell--parent-buffer (current-buffer))
2410 (process (get-buffer-process buffer)) 2409 (process (get-buffer-process buffer))
2411 ;; As the user may have overriden default values for 2410 ;; As the user may have overridden default values for
2412 ;; these vars on `run-python', let-binding them allows 2411 ;; these vars on `run-python', let-binding them allows
2413 ;; to have the new right values in all setup code 2412 ;; to have the new right values in all setup code
2414 ;; that's is done in `inferior-python-mode', which is 2413 ;; that's is done in `inferior-python-mode', which is
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index dce99607074..18843bcd15a 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -808,7 +808,7 @@ Not smaller than the value set by `tex-suscript-height-minimum'."
808(defvar tex-verbatim-face 'tex-verbatim) 808(defvar tex-verbatim-face 'tex-verbatim)
809 809
810(defun tex-font-lock-verb (start delim) 810(defun tex-font-lock-verb (start delim)
811 "Place syntax table properties on the \verb construct. 811 "Place syntax table properties on the \\verb construct.
812START is the position of the \\ and DELIM is the delimiter char." 812START is the position of the \\ and DELIM is the delimiter char."
813 ;; Do nothing if the \verb construct is itself inside a comment or 813 ;; Do nothing if the \verb construct is itself inside a comment or
814 ;; verbatim env. 814 ;; verbatim env.
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index ce7f2c8f4ed..df660d193e2 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -633,8 +633,15 @@ this function."
633 (throw 'found trial)))) 633 (throw 'found trial))))
634 templates)))) 634 templates))))
635 635
636(define-obsolete-function-alias 636
637 'vc-toggle-read-only 'toggle-read-only "24.1") 637;; toggle-read-only is obsolete since 24.3, but since vc-t-r-o was made
638;; obsolete earlier, it is ok for the latter to be an alias to the former,
639;; since the latter will be removed first. We can't just make it
640;; an alias for read-only-mode, since that is not 100% the same.
641(defalias 'vc-toggle-read-only 'toggle-read-only)
642(make-obsolete 'vc-toggle-read-only
643 "use `read-only-mode' instead (or `toggle-read-only' in older versions of Emacs)."
644 "24.1")
638 645
639(defun vc-default-make-version-backups-p (_backend _file) 646(defun vc-default-make-version-backups-p (_backend _file)
640 "Return non-nil if unmodified versions should be backed up locally. 647 "Return non-nil if unmodified versions should be backed up locally.
diff --git a/lisp/window.el b/lisp/window.el
index a7dcd9a6612..f55f0657a30 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2286,7 +2286,7 @@ Optional argument HORIZONTAL non-nil means assign new total
2286window widths from pixel widths." 2286window widths from pixel widths."
2287 (setq frame (window-normalize-frame frame)) 2287 (setq frame (window-normalize-frame frame))
2288 (let* ((char-size (frame-char-size frame horizontal)) 2288 (let* ((char-size (frame-char-size frame horizontal))
2289 (root (frame-root-window)) 2289 (root (frame-root-window frame))
2290 (root-size (window-size root horizontal t)) 2290 (root-size (window-size root horizontal t))
2291 ;; We have to care about the minibuffer window only if it 2291 ;; We have to care about the minibuffer window only if it
2292 ;; appears together with the root window on this frame. 2292 ;; appears together with the root window on this frame.
diff --git a/src/.gdbinit b/src/.gdbinit
index fb2a9bf72ed..c10fe3ddded 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -820,15 +820,7 @@ define xwindow
820 xgetptr $ 820 xgetptr $
821 print (struct window *) $ptr 821 print (struct window *) $ptr
822 set $window = (struct window *) $ptr 822 set $window = (struct window *) $ptr
823 xgetint $window->total_cols 823 printf "%dx%d+%d+%d\n", $window->total_cols, $window->total_lines, $window->left_col, $window->top_line
824 set $width=$int
825 xgetint $window->total_lines
826 set $height=$int
827 xgetint $window->left_col
828 set $left=$int
829 xgetint $window->top_line
830 set $top=$int
831 printf "%dx%d+%d+%d\n", $width, $height, $left, $top
832end 824end
833document xwindow 825document xwindow
834Print $ as a window pointer, assuming it is an Emacs Lisp window value. 826Print $ as a window pointer, assuming it is an Emacs Lisp window value.
diff --git a/src/ChangeLog b/src/ChangeLog
index f74a46c4ad2..57d49594d7a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12014-07-28 Eli Zaretskii <eliz@gnu.org> 12014-07-28 Eli Zaretskii <eliz@gnu.org>
2 2
3 * .gdbinit (xwindow): The members total_cols, total_lines,
4 left_col, and top_line are C integers (and has been so for the
5 last 1.5 years).
6
3 * .gdbinit (xsubchartable): The members 'depth' and 'min_char' are 7 * .gdbinit (xsubchartable): The members 'depth' and 'min_char' are
4 now C integers. 8 now C integers.
5 9
@@ -4479,7 +4483,7 @@
4479 Avoid undefined behavior with huge regexp interval counts. 4483 Avoid undefined behavior with huge regexp interval counts.
4480 * regex.c (GET_INTERVAL_COUNT): Rename from 'GET_UNSIGNED_NUMBER', 4484 * regex.c (GET_INTERVAL_COUNT): Rename from 'GET_UNSIGNED_NUMBER',
4481 since it's now specialized to interval counts. All uses changed. 4485 since it's now specialized to interval counts. All uses changed.
4482 Do not assume wrapraound on signed integer overflow. 4486 Do not assume wraparound on signed integer overflow.
4483 (regex_compile): Simplify based on the above changes. 4487 (regex_compile): Simplify based on the above changes.
4484 4488
44852013-12-12 Eli Zaretskii <eliz@gnu.org> 44892013-12-12 Eli Zaretskii <eliz@gnu.org>
diff --git a/src/dispnew.c b/src/dispnew.c
index 289431d6dc4..70862985e66 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1638,7 +1638,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1638 1638
1639 /* Actually change matrices, if allowed. Do not consider 1639 /* Actually change matrices, if allowed. Do not consider
1640 CHANGED_LEAF_MATRIX computed above here because the pool 1640 CHANGED_LEAF_MATRIX computed above here because the pool
1641 may have been changed which we don't now here. We trust 1641 may have been changed which we don't know here. We trust
1642 that we only will be called with DIM_ONLY_P when 1642 that we only will be called with DIM_ONLY_P when
1643 necessary. */ 1643 necessary. */
1644 if (!dim_only_p) 1644 if (!dim_only_p)
diff --git a/src/window.c b/src/window.c
index ae28b714720..e3554ea032e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3854,7 +3854,7 @@ window_resize_check (struct window *w, bool horflag)
3854} 3854}
3855 3855
3856 3856
3857/* Set w->pixel_height (w->pixel_height if HORIZONTAL is non-zero) to 3857/* Set w->pixel_height (w->pixel_width if HORFLAG is non-zero) to
3858 w->new_pixel for window W and recursively all child windows of W. 3858 w->new_pixel for window W and recursively all child windows of W.
3859 Also calculate and assign the new vertical (horizontal) pixel start 3859 Also calculate and assign the new vertical (horizontal) pixel start
3860 positions of each of these windows. 3860 positions of each of these windows.
@@ -3944,7 +3944,7 @@ window_resize_apply (struct window *w, bool horflag)
3944} 3944}
3945 3945
3946 3946
3947/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to 3947/* Set w->total_lines (w->total_cols if HORFLAG is non-zero) to
3948 w->new_total for window W and recursively all child windows of W. 3948 w->new_total for window W and recursively all child windows of W.
3949 Also calculate and assign the new vertical (horizontal) start 3949 Also calculate and assign the new vertical (horizontal) start
3950 positions of each of these windows. */ 3950 positions of each of these windows. */
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 81f4567091e..e1eaeea2c38 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -1807,7 +1807,7 @@ Using `python-shell-interpreter' and
1807 (kill-buffer shell-buffer)))) 1807 (kill-buffer shell-buffer))))
1808 1808
1809(ert-deftest python-shell-make-comint-3 () 1809(ert-deftest python-shell-make-comint-3 ()
1810 "Check comint creation with overriden python interpreter and args. 1810 "Check comint creation with overridden python interpreter and args.
1811The command passed to `python-shell-make-comint' as argument must 1811The command passed to `python-shell-make-comint' as argument must
1812locally override global values set in `python-shell-interpreter' 1812locally override global values set in `python-shell-interpreter'
1813and `python-shell-interpreter-args' in the new shell buffer." 1813and `python-shell-interpreter-args' in the new shell buffer."