------------------------------------------------------------ revno: 117605 committer: Fabi?n Ezequiel Gallina branch nick: trunk timestamp: Mon 2014-07-28 18:07:10 -0300 message: * lisp/progmodes/python.el (inferior-python-mode): Make input prompts read-only. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-28 19:14:21 +0000 +++ lisp/ChangeLog 2014-07-28 21:07:10 +0000 @@ -1,3 +1,8 @@ +2014-07-28 Fabián Ezequiel Gallina + + * progmodes/python.el (inferior-python-mode): Make input prompts + read-only. + 2014-07-28 Emilio C. Lopes * net/tramp-sh.el (tramp-get-remote-python): Also search for === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2014-07-28 09:39:09 +0000 +++ lisp/progmodes/python.el 2014-07-28 21:07:10 +0000 @@ -2357,7 +2357,8 @@ (set (make-local-variable 'python-shell--prompt-calculated-input-regexp) nil) (set (make-local-variable 'python-shell--prompt-calculated-output-regexp) nil) (python-shell-prompt-set-calculated-regexps) - (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp) + (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp + comint-prompt-read-only t) (setq mode-line-process '(":%s")) (set (make-local-variable 'comint-output-filter-functions) '(ansi-color-process-output @@ -2381,6 +2382,10 @@ (compilation-shell-minor-mode 1) ;; Ensure all the output is accepted before running any hooks. (accept-process-output (get-buffer-process (current-buffer))) + ;; At this point, all process output should have been received, but + ;; on GNU/Linux, calling `python-shell-internal-send-string' without + ;; a running internal shell fails to grab output properly unless + ;; this `sit-for' is in place. (sit-for 0.1 t)) (defun python-shell-make-comint (cmd proc-name &optional pop internal) ------------------------------------------------------------ revno: 117604 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-07-28 21:14:21 +0200 message: Fix Changelog typo, introduced by last commit. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-28 19:08:43 +0000 +++ lisp/ChangeLog 2014-07-28 19:14:21 +0000 @@ -6,7 +6,7 @@ arguments to `print' to make it compatible with Python 3. (tramp-get-remote-gid-with-python): Ditto. (Bug#18118) -22014-07-28 Eli Zaretskii +2014-07-28 Eli Zaretskii * window.el (window--pixel-to-total): Use FRAME's root window, not that of the selected frame. (Bug#18112, Bug#16674) ------------------------------------------------------------ revno: 117603 fixes bug: http://debbugs.gnu.org/18118 author: Emilio C. Lopes committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-07-28 21:08:43 +0200 message: * net/tramp-sh.el (tramp-get-remote-python): Also search for executables named "python2" or "python3". (tramp-get-remote-uid-with-python): Use parentheses around arguments to `print' to make it compatible with Python 3. (tramp-get-remote-gid-with-python): Ditto. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-28 09:39:09 +0000 +++ lisp/ChangeLog 2014-07-28 19:08:43 +0000 @@ -1,4 +1,12 @@ -2014-07-28 Eli Zaretskii +2014-07-28 Emilio C. Lopes + + * net/tramp-sh.el (tramp-get-remote-python): Also search for + executables named "python2" or "python3". + (tramp-get-remote-uid-with-python): Use parentheses around + arguments to `print' to make it compatible with Python 3. + (tramp-get-remote-gid-with-python): Ditto. (Bug#18118) + +22014-07-28 Eli Zaretskii * window.el (window--pixel-to-total): Use FRAME's root window, not that of the selected frame. (Bug#18112, Bug#16674) === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-07-03 09:27:02 +0000 +++ lisp/net/tramp-sh.el 2014-07-28 19:08:43 +0000 @@ -5256,7 +5256,9 @@ (defun tramp-get-remote-python (vec) (with-tramp-connection-property vec "python" (tramp-message vec 5 "Finding a suitable `python' command") - (tramp-find-executable vec "python" (tramp-get-remote-path vec)))) + (or (tramp-find-executable vec "python" (tramp-get-remote-path vec)) + (tramp-find-executable vec "python2" (tramp-get-remote-path vec)) + (tramp-find-executable vec "python3" (tramp-get-remote-path vec))))) (defun tramp-get-remote-uid-with-python (vec id-format) (tramp-send-command-and-read @@ -5264,8 +5266,8 @@ (format "%s -c \"%s\"" (tramp-get-remote-python vec) (if (equal id-format 'integer) - "import os; print os.getuid()" - "import os, pwd; print '\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"'")))) + "import os; print (os.getuid())" + "import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"')")))) (defun tramp-get-remote-uid (vec id-format) (with-tramp-connection-property vec (format "uid-%s" id-format) @@ -5305,8 +5307,8 @@ (format "%s -c \"%s\"" (tramp-get-remote-python vec) (if (equal id-format 'integer) - "import os; print os.getgid()" - "import os, grp; print '\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"'")))) + "import os; print (os.getgid())" + "import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"')")))) (defun tramp-get-remote-gid (vec id-format) (with-tramp-connection-property vec (format "gid-%s" id-format) ------------------------------------------------------------ revno: 117602 committer: martin rudalics branch nick: trunk timestamp: Mon 2014-07-28 19:03:23 +0200 message: Fix some issues with setting the frame height. * frame.c (x_set_frame_parameters): Revert part of 2014-07-24 change that added the top margin height to the requested height and revert (undocumented) part of 2014-07-28 change that changed the logic of whether a size change occurred. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-28 14:50:55 +0000 +++ src/ChangeLog 2014-07-28 17:03:23 +0000 @@ -1,3 +1,10 @@ +2014-07-28 Martin Rudalics + + * frame.c (x_set_frame_parameters): Revert part of 2014-07-24 + change that added the top margin height to the requested height + and revert (undocumented) part of 2014-07-28 change that changed + the logic of whether a size change occurred. + 2014-07-28 Eli Zaretskii * .gdbinit (xwindow): The members total_cols, total_lines, === modified file 'src/frame.c' --- src/frame.c 2014-07-28 08:07:55 +0000 +++ src/frame.c 2014-07-28 17:03:23 +0000 @@ -3116,9 +3116,7 @@ else if (EQ (prop, Qheight) && RANGED_INTEGERP (0, val, INT_MAX)) { height_change = 1; - /* Add menu and tool bar lines to correctly resize F pixelwise. */ - height - = (XFASTINT (val) + FRAME_TOP_MARGIN (f)) * FRAME_LINE_HEIGHT (f); + height = XFASTINT (val) * FRAME_LINE_HEIGHT (f); } else if (EQ (prop, Qtop)) top = val; @@ -3200,9 +3198,10 @@ XSETFRAME (frame, f); - if (((width_change && width != FRAME_TEXT_WIDTH (f)) - || (height_change && height != FRAME_TEXT_HEIGHT (f))) - && (f->new_height || f->new_width)) + if ((width_change || height_change) + && (width != FRAME_TEXT_WIDTH (f) + || height != FRAME_TEXT_HEIGHT (f) + || f->new_height || f->new_width)) { /* If necessary provide default values for HEIGHT and WIDTH. Do that here since otherwise a size change implied by an ------------------------------------------------------------ revno: 117601 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2014-07-28 18:50:55 +0400 message: Fix Gnus-related issues reported by David Kastrup in . * atimer.c (timerfd_callback): Always read expiration data. Add comment. (turn_on_atimers) [HAVE_TIMERFD]: Disarm timerfd timer. * process.c (add_timer_wait_descriptor): Add timer descriptor to input_wait_mask and non_process_wait_mask as well. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-28 09:39:09 +0000 +++ src/ChangeLog 2014-07-28 14:50:55 +0000 @@ -35,6 +35,14 @@ Define as no-op. (adjust_frame_size): Always declare prototype. + Fix Gnus-related issues reported by David Kastrup in + . + * atimer.c (timerfd_callback): Always read expiration data. + Add comment. + (turn_on_atimers) [HAVE_TIMERFD]: Disarm timerfd timer. + * process.c (add_timer_wait_descriptor): Add timer descriptor + to input_wait_mask and non_process_wait_mask as well. + 2014-07-28 Paul Eggert * frame.c (x_set_frame_parameters): Don't use uninitialized locals. === modified file 'src/atimer.c' --- src/atimer.c 2014-07-28 06:28:15 +0000 +++ src/atimer.c 2014-07-28 14:50:55 +0000 @@ -410,9 +410,19 @@ #ifdef HAVE_TIMERFD +/* Called from wait_reading_process_output when FD, which + should be equal to TIMERFD, is available for reading. */ + void timerfd_callback (int fd, void *arg) { + char buf[8]; + ptrdiff_t nbytes; + + eassert (fd == timerfd); + nbytes = emacs_read (fd, buf, sizeof (buf)); + /* Just discard an expiration count for now. */ + eassert (nbytes == sizeof (buf)); do_pending_atimers (); } @@ -442,7 +452,18 @@ if (on) set_alarm (); else - alarm (0); + { +#ifdef HAVE_TIMERFD + if (special_timer_available > 1) + { + struct itimerspec ispec; + memset (&ispec, 0, sizeof (ispec)); + /* Writing zero expiration time should disarm it. */ + timerfd_settime (timerfd, TFD_TIMER_ABSTIME, &ispec, 0); + } +#endif /* HAVE_TIMERFD */ + alarm (0); + } } /* This is intended to use from automated tests. */ === modified file 'src/process.c' --- src/process.c 2014-07-28 06:28:15 +0000 +++ src/process.c 2014-07-28 14:50:55 +0000 @@ -6835,7 +6835,9 @@ void add_timer_wait_descriptor (int fd) { + FD_SET (fd, &input_wait_mask); FD_SET (fd, &non_keyboard_wait_mask); + FD_SET (fd, &non_process_wait_mask); fd_callback_info[fd].func = timerfd_callback; fd_callback_info[fd].data = NULL; fd_callback_info[fd].condition |= FOR_READ; ------------------------------------------------------------ revno: 117600 [merge] committer: Glenn Morris branch nick: trunk timestamp: Mon 2014-07-28 05:39:09 -0400 message: Merge from emacs-24; up to r117412 diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-07-18 08:23:49 +0000 +++ doc/misc/ChangeLog 2014-07-28 09:39:09 +0000 @@ -1,3 +1,8 @@ +2014-07-28 Stephen Berman + + * todo-mode.texi (Marked Items): Correct omission of item deletion + from commands applying to both todo and done items. + 2014-07-18 Albert Krewinkel * gnus.texi (Posting Styles): Document the possibility to perform === modified file 'doc/misc/todo-mode.texi' --- doc/misc/todo-mode.texi 2014-07-09 02:04:12 +0000 +++ doc/misc/todo-mode.texi 2014-07-28 09:39:09 +0000 @@ -1323,10 +1323,11 @@ noncontiguous marked items, the relocated items retain their relative order but are now listed consecutively en bloc. -You can mark both todo and done items, but note that only @kbd{m} can apply -to both; other commands only affect either marked todo or marked done -items, so if both types of items are marked, invoking these commands -has no effect and informs you of your erroneous attempt. +You can mark both todo and done items, but note that only @kbd{m} and +@kbd{k} can apply to both; other commands only affect either marked +todo or marked done items, so if both types of items are marked, +invoking these commands has no effect and informs you of your +erroneous attempt. @node Todo Categories Mode, Searching for Items, Marked Items, Top @chapter Todo Categories Mode === modified file 'etc/DEBUG' --- etc/DEBUG 2014-01-01 07:43:34 +0000 +++ etc/DEBUG 2014-07-26 13:40:53 +0000 @@ -7,9 +7,9 @@ [People who debug Emacs on Windows using Microsoft debuggers should read the Windows-specific section near the end of this document.] -** When you debug Emacs with GDB, you should start it in the directory -where the executable was made (the 'src' directory in the Emacs source -tree). That directory has a .gdbinit file that defines various +** When you debug Emacs with GDB, you should start GDB in the directory +where the Emacs executable was made (the 'src' directory in the Emacs +source tree). That directory has a .gdbinit file that defines various "user-defined" commands for debugging Emacs. (These commands are described below under "Examining Lisp object values" and "Debugging Emacs Redisplay problems".) @@ -21,7 +21,9 @@ warning: File ".../src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". There are several ways to overcome that difficulty, they are all -described in the node "Auto-loading safe path" in the GDB user manual. +described in the node "Auto-loading safe path" in the GDB user +manual. If nothing else helps, type "source /path/to/.gdbinit RET" at +the GDB prompt, to unconditionally load the GDB init file. ** When you are trying to analyze failed assertions or backtraces, it is essential to compile Emacs with flags suitable for debugging. === modified file 'etc/NEWS' --- etc/NEWS 2014-07-21 06:03:08 +0000 +++ etc/NEWS 2014-07-28 09:39:09 +0000 @@ -873,7 +873,7 @@ ** Python mode *** Out of the box support for CPython, iPython and readline based shells. -**** `python-shell-completion-module-string-code` is no longer used. +**** `python-shell-completion-module-string-code' is no longer used. *** Automatic shell prompt detection. New user options: **** `python-shell-interpreter-interactive-arg'. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-28 09:07:56 +0000 +++ lisp/ChangeLog 2014-07-28 09:39:09 +0000 @@ -1,3 +1,49 @@ +2014-07-28 Eli Zaretskii + + * window.el (window--pixel-to-total): Use FRAME's root window, not + that of the selected frame. (Bug#18112, Bug#16674) + +2014-07-28 Andreas Schwab + + * textmodes/tex-mode.el (tex-font-lock-verb): Doc fix. + (Bug#18117) + +2014-07-28 Fabián Ezequiel Gallina + + * progmodes/python.el (inferior-python-mode): Doc fix. + +2014-07-28 Stephen Berman + + * calendar/todo-mode.el (todo-edit-item--next-key): If next key is + not a character, ignore it instead of raising an error. + + * calendar/todo-mode.el: Fix handling of marked items and make + minor code improvements. + (todo-edit-item): If there are marked items, ensure user can only + invoke editing commands that work with marked items. + (todo-edit-item--text): When there are marked items, make it a + noop if invoked with point not on an item; otherwise, ensure it + applies only to item at point. + (todo-item-undone): If there are marked not-done items, return + point to its original position before signaling user error. + (todo--user-error-if-marked-done-item): New function. + (todo-edit-item--header, todo-edit-item--diary-inclusion) + (todo-item-done): Use it. + +2014-07-28 Glenn Morris + + * files.el (toggle-read-only): Re-add basic doc-string. + * vc/vc-hooks.el (vc-toggle-read-only): Tweak obsolescence mesage. + + * progmodes/prolog.el (prolog-mode-keybindings-edit): + Replace missing `switch-to-prolog' with `run-prolog'. + (switch-to-prolog): Define as (obsolete) alias, as in 23.4. + +2014-07-28 Stephen Berman + + * calendar/todo-mode.el (todo-set-top-priorities): Fix overwriting + of file-wide setting when changing category-wide setting. + 2014-07-28 Stephen Berman * doc-view.el (doc-view-open-text): Don't require that the === modified file 'lisp/calendar/todo-mode.el' --- lisp/calendar/todo-mode.el 2014-07-09 02:04:12 +0000 +++ lisp/calendar/todo-mode.el 2014-07-28 09:39:09 +0000 @@ -2068,87 +2068,101 @@ (defun todo-edit-item (&optional arg) "Choose an editing operation for the current item and carry it out." (interactive "P") - (cond ((todo-done-item-p) - (todo-edit-item--next-key todo-edit-done-item--param-key-alist)) - ((todo-item-string) - (todo-edit-item--next-key todo-edit-item--param-key-alist arg)))) + (let ((marked (assoc (todo-current-category) todo-categories-with-marks))) + (cond ((and (todo-done-item-p) (not marked)) + (todo-edit-item--next-key todo-edit-done-item--param-key-alist)) + ((or marked (todo-item-string)) + (todo-edit-item--next-key todo-edit-item--param-key-alist arg))))) (defun todo-edit-item--text (&optional arg) "Function providing the text editing facilities of `todo-edit-item'." - (let* ((opoint (point)) - (start (todo-item-start)) - (end (save-excursion (todo-item-end))) - (item-beg (progn - (re-search-forward - (concat todo-date-string-start todo-date-pattern - "\\( " diary-time-regexp "\\)?" - (regexp-quote todo-nondiary-end) "?") - (line-end-position) t) - (1+ (- (point) start)))) - (include-header (eq arg 'include-header)) - (comment-edit (eq arg 'comment-edit)) - (comment-delete (eq arg 'comment-delete)) - (header-string (substring (todo-item-string) 0 item-beg)) - (item (if (or include-header comment-edit comment-delete) - (todo-item-string) - (substring (todo-item-string) item-beg))) - (multiline (> (length (split-string item "\n")) 1)) - (comment (save-excursion - (todo-item-start) - (re-search-forward - (concat " \\[" (regexp-quote todo-comment-string) - ": \\([^]]+\\)\\]") end t))) - (prompt (if comment "Edit comment: " "Enter a comment: ")) - (buffer-read-only nil)) - (cond - ((or comment-edit comment-delete) - (save-excursion - (todo-item-start) - (if (re-search-forward (concat " \\[" (regexp-quote todo-comment-string) - ": \\([^]]+\\)\\]") - end t) - (if comment-delete - (when (todo-y-or-n-p "Delete comment? ") - (delete-region (match-beginning 0) (match-end 0))) - (replace-match (read-string prompt (cons (match-string 1) 1)) - nil nil nil 1)) - (if comment-delete - (user-error "There is no comment to delete") - (insert " [" todo-comment-string ": " - (prog1 (read-string prompt) - ;; If user moved point during editing, - ;; make sure it moves back. - (goto-char opoint) - (todo-item-end)) - "]"))))) - ((or multiline (eq arg 'multiline)) - (let ((buf todo-edit-buffer)) - (set-window-buffer (selected-window) - (set-buffer (make-indirect-buffer (buffer-name) buf))) - (narrow-to-region (todo-item-start) (todo-item-end)) - (todo-edit-mode) - (message "%s" (substitute-command-keys - (concat "Type \\[todo-edit-quit] " - "to return to Todo mode.\n"))))) - (t - (let ((new (concat (if include-header "" header-string) - (read-string "Edit: " (if include-header - (cons item item-beg) - (cons item 0)))))) - (when include-header - (while (not (string-match (concat todo-date-string-start - todo-date-pattern) - new)) - (setq new (read-from-minibuffer - "Item must start with a date: " new)))) - ;; Ensure lines following hard newlines are indented. - (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]" - "\n\t" new nil nil 1)) - ;; If user moved point during editing, make sure it moves back. - (goto-char opoint) - (todo-remove-item) - (todo-insert-with-overlays new) - (move-to-column item-beg)))))) + (let ((full-item (todo-item-string))) + ;; If there are marked items and user invokes a text-editing + ;; commands with point not on an item, todo-item-start is nil and + ;; 1+ signals an error, so just make this a noop. + (when full-item + (let* ((opoint (point)) + (start (todo-item-start)) + (end (save-excursion (todo-item-end))) + (item-beg (progn + (re-search-forward + (concat todo-date-string-start todo-date-pattern + "\\( " diary-time-regexp "\\)?" + (regexp-quote todo-nondiary-end) "?") + (line-end-position) t) + (1+ (- (point) start)))) + (include-header (eq arg 'include-header)) + (comment-edit (eq arg 'comment-edit)) + (comment-delete (eq arg 'comment-delete)) + (header-string (substring full-item 0 item-beg)) + (item (if (or include-header comment-edit comment-delete) + full-item + (substring full-item item-beg))) + (multiline (or (eq arg 'multiline) + (> (length (split-string item "\n")) 1))) + (comment (save-excursion + (todo-item-start) + (re-search-forward + (concat " \\[" (regexp-quote todo-comment-string) + ": \\([^]]+\\)\\]") end t))) + (prompt (if comment "Edit comment: " "Enter a comment: ")) + (buffer-read-only nil)) + ;; When there are marked items, user can invoke todo-edit-item + ;; even if point is not on an item, but text editing only + ;; applies to the item at point. + (when (or (and (todo-done-item-p) + (or comment-edit comment-delete)) + (and (not (todo-done-item-p)) + (or (not arg) include-header multiline))) + (cond + ((or comment-edit comment-delete) + (save-excursion + (todo-item-start) + (if (re-search-forward (concat " \\[" + (regexp-quote todo-comment-string) + ": \\([^]]+\\)\\]") end t) + (if comment-delete + (when (todo-y-or-n-p "Delete comment? ") + (delete-region (match-beginning 0) (match-end 0))) + (replace-match (read-string prompt (cons (match-string 1) 1)) + nil nil nil 1)) + (if comment-delete + (user-error "There is no comment to delete") + (insert " [" todo-comment-string ": " + (prog1 (read-string prompt) + ;; If user moved point during editing, + ;; make sure it moves back. + (goto-char opoint) + (todo-item-end)) + "]"))))) + (multiline + (let ((buf todo-edit-buffer)) + (set-window-buffer (selected-window) + (set-buffer (make-indirect-buffer + (buffer-name) buf))) + (narrow-to-region (todo-item-start) (todo-item-end)) + (todo-edit-mode) + (message "%s" (substitute-command-keys + (concat "Type \\[todo-edit-quit] " + "to return to Todo mode.\n"))))) + (t + (let ((new (concat (if include-header "" header-string) + (read-string "Edit: " (if include-header + (cons item item-beg) + (cons item 0)))))) + (when include-header + (while (not (string-match (concat todo-date-string-start + todo-date-pattern) new)) + (setq new (read-from-minibuffer + "Item must start with a date: " new)))) + ;; Ensure lines following hard newlines are indented. + (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]" + "\n\t" new nil nil 1)) + ;; If user moved point during editing, make sure it moves back. + (goto-char opoint) + (todo-remove-item) + (todo-insert-with-overlays new) + (move-to-column item-beg))))))))) (defun todo-edit-quit () "Return from Todo Edit mode to Todo mode. @@ -2203,16 +2217,16 @@ (defun todo-edit-item--header (what &optional inc) "Function providing header editing facilities of `todo-edit-item'." - (let* ((cat (todo-current-category)) - (marked (assoc cat todo-categories-with-marks)) - (first t) - (todo-date-from-calendar t) - ;; INC must be an integer, but users could pass it via - ;; `todo-edit-item' as e.g. `-' or `C-u'. - (inc (prefix-numeric-value inc)) - (buffer-read-only nil) - ndate ntime year monthname month day - dayname) ; Needed by calendar-date-display-form. + (let ((marked (assoc (todo-current-category) todo-categories-with-marks)) + (first t) + (todo-date-from-calendar t) + ;; INC must be an integer, but users could pass it via + ;; `todo-edit-item' as e.g. `-' or `C-u'. + (inc (prefix-numeric-value inc)) + (buffer-read-only nil) + ndate ntime year monthname month day + dayname) ; Needed by calendar-date-display-form. + (when marked (todo--user-error-if-marked-done-item)) (save-excursion (or (and marked (goto-char (point-min))) (todo-item-start)) (catch 'end @@ -2374,47 +2388,45 @@ (defun todo-edit-item--diary-inclusion (&optional nonmarking) "Function providing diary marking facilities of `todo-edit-item'." (let ((buffer-read-only) - (marked (assoc (todo-current-category) - todo-categories-with-marks))) + (marked (assoc (todo-current-category) todo-categories-with-marks))) + (when marked (todo--user-error-if-marked-done-item)) (catch 'stop (save-excursion (when marked (goto-char (point-min))) (while (not (eobp)) - (if (todo-done-item-p) - (throw 'stop (message "Done items cannot be edited")) - (unless (and marked (not (todo-marked-item-p))) - (let* ((beg (todo-item-start)) - (lim (save-excursion (todo-item-end))) - (end (save-excursion - (or (todo-time-string-matcher lim) - (todo-date-string-matcher lim))))) - (if nonmarking - (if (looking-at (regexp-quote diary-nonmarking-symbol)) - (replace-match "") - (when (looking-at (regexp-quote todo-nondiary-start)) - (save-excursion - (replace-match "") - (search-forward todo-nondiary-end (1+ end) t) - (replace-match "") - (todo-update-count 'diary 1))) - (insert diary-nonmarking-symbol)) - (if (looking-at (regexp-quote todo-nondiary-start)) - (progn + (unless (and marked (not (todo-marked-item-p))) + (let* ((beg (todo-item-start)) + (lim (save-excursion (todo-item-end))) + (end (save-excursion + (or (todo-time-string-matcher lim) + (todo-date-string-matcher lim))))) + (if nonmarking + (if (looking-at (regexp-quote diary-nonmarking-symbol)) + (replace-match "") + (when (looking-at (regexp-quote todo-nondiary-start)) + (save-excursion (replace-match "") (search-forward todo-nondiary-end (1+ end) t) (replace-match "") - (todo-update-count 'diary 1)) - (when end - (when (looking-at (regexp-quote diary-nonmarking-symbol)) - (replace-match "") - (setq end (1- end))) ; Since we deleted nonmarking symbol. - (insert todo-nondiary-start) - (goto-char (1+ end)) - (insert todo-nondiary-end) - (todo-update-count 'diary -1)))))) - (unless marked (throw 'stop nil)) - (todo-forward-item))))) - (todo-update-categories-sexp))) + (todo-update-count 'diary 1))) + (insert diary-nonmarking-symbol)) + (if (looking-at (regexp-quote todo-nondiary-start)) + (progn + (replace-match "") + (search-forward todo-nondiary-end (1+ end) t) + (replace-match "") + (todo-update-count 'diary 1)) + (when end + (when (looking-at (regexp-quote diary-nonmarking-symbol)) + (replace-match "") + (setq end (1- end))) ; Since we deleted nonmarking symbol. + (insert todo-nondiary-start) + (goto-char (1+ end)) + (insert todo-nondiary-end) + (todo-update-count 'diary -1)))))) + (unless marked (throw 'stop nil)) + (todo-forward-item))))) + (todo-update-categories-sexp)) (defun todo-edit-category-diary-inclusion (arg) "Make all items in this category diary items. @@ -2785,21 +2797,7 @@ (interactive "P") (let* ((cat (todo-current-category)) (marked (assoc cat todo-categories-with-marks))) - (when marked - (save-excursion - (save-restriction - (goto-char (point-max)) - (todo-backward-item) - (unless (todo-done-item-p) - (widen) - (unless (re-search-forward - (concat "^" (regexp-quote todo-category-beg)) nil t) - (goto-char (point-max))) - (forward-line -1)) - (while (todo-done-item-p) - (when (todo-marked-item-p) - (user-error "This command does not apply to done items")) - (todo-backward-item))))) + (when marked (todo--user-error-if-marked-done-item)) (unless (and (not marked) (or (todo-done-item-p) ;; Point is between todo and done items. @@ -2887,7 +2885,9 @@ (while (not (eobp)) (when (or (not marked) (and marked (todo-marked-item-p))) (if (not (todo-done-item-p)) - (user-error "Only done items can be undone") + (progn + (goto-char opoint) + (user-error "Only done items can be undone")) (todo-item-start) (unless marked (setq ov (make-overlay (save-excursion (todo-item-start)) @@ -4285,24 +4285,25 @@ (frule (assoc-string file rules)) (crules (nth 2 frule)) (crule (assoc-string cat crules)) - (cur (or (and arg (cdr crule)) - (nth 1 frule) - todo-top-priorities)) + (fcur (or (nth 1 frule) + todo-top-priorities)) + (ccur (or (and arg (cdr crule)) + fcur)) (prompt (if arg (concat "Number of top priorities in this category" " (currently %d): ") (concat "Default number of top priorities per category" " in this file (currently %d): "))) (new -1)) (while (< new 0) - (let ((cur0 cur)) - (setq new (read-number (format prompt cur0)) + (let ((cur (if arg ccur fcur))) + (setq new (read-number (format prompt cur)) prompt "Enter a non-negative number: " - cur0 nil))) + cur nil))) (let ((nrule (if arg (append (delete crule crules) (list (cons cat new))) (append (list file new) (list crules))))) (setq rules (cons (if arg - (list file cur nrule) + (list file fcur nrule) nrule) (delete frule rules))) (customize-save-variable 'todo-top-priorities-overrides rules) @@ -5223,6 +5224,25 @@ (progn (goto-char (point-min)) (looking-at todo-done-string-start))))) +(defun todo--user-error-if-marked-done-item () + "Signal user error on marked done items. +Helper funtion for editing commands that only apply to (possibly +marked) not done todo items." + (save-excursion + (save-restriction + (goto-char (point-max)) + (todo-backward-item) + (unless (todo-done-item-p) + (widen) + (unless (re-search-forward + (concat "^" (regexp-quote todo-category-beg)) nil t) + (goto-char (point-max))) + (forward-line -1)) + (while (todo-done-item-p) + (when (todo-marked-item-p) + (user-error "This command does not apply to done items")) + (todo-backward-item))))) + (defun todo-reset-done-separator (sep) "Replace existing overlays of done items separator string SEP." (save-excursion @@ -5531,8 +5551,8 @@ '(add/edit delete)) " comment")))) params " ")) - (this-key (char-to-string - (read-key (concat todo-edit-item--prompt p->k)))) + (this-key (let ((key (read-key (concat todo-edit-item--prompt p->k)))) + (and (characterp key) (char-to-string key)))) (this-param (car (rassoc this-key params)))) (pcase this-param (`edit (todo-edit-item--text)) === modified file 'lisp/files.el' --- lisp/files.el 2014-07-21 06:03:08 +0000 +++ lisp/files.el 2014-07-28 09:39:09 +0000 @@ -5017,6 +5017,7 @@ (set-buffer-modified-p arg)) (defun toggle-read-only (&optional arg interactive) + "Change whether this buffer is read-only." (declare (obsolete read-only-mode "24.3")) (interactive (list current-prefix-arg t)) (if interactive === modified file 'lisp/progmodes/prolog.el' --- lisp/progmodes/prolog.el 2014-05-29 03:45:29 +0000 +++ lisp/progmodes/prolog.el 2014-07-28 09:39:09 +0000 @@ -1079,7 +1079,7 @@ ;; Inherited from the old prolog.el. (define-key map "\e\C-x" 'prolog-consult-region) (define-key map "\C-c\C-l" 'prolog-consult-file) - (define-key map "\C-c\C-z" 'switch-to-prolog)) + (define-key map "\C-c\C-z" 'run-prolog)) (defun prolog-mode-keybindings-inferior (_map) "Define keybindings for inferior Prolog mode in MAP." @@ -1240,6 +1240,8 @@ ((string-match "\\`[rf] *[0-9]*\\'" str) nil) ;r(edo) or f(ail) (t t))) +;; This statement was missing in Emacs 24.1, 24.2, 24.3. +(define-obsolete-function-alias 'switch-to-prolog 'run-prolog "24.1") ;;;###autoload (defun run-prolog (arg) "Run an inferior Prolog process, input and output via buffer *prolog*. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2014-07-28 04:32:28 +0000 +++ lisp/progmodes/python.el 2014-07-28 09:39:09 +0000 @@ -2332,7 +2332,6 @@ `python-shell-font-lock-enable', `python-shell-completion-setup-code', `python-shell-completion-string-code', -`python-shell-completion-module-string-code', `python-eldoc-setup-code', `python-eldoc-string-code', `python-ffap-setup-code' and `python-ffap-string-code' can customize this mode for different Python interpreters. @@ -2408,7 +2407,7 @@ interpreter nil args)) (python-shell--parent-buffer (current-buffer)) (process (get-buffer-process buffer)) - ;; As the user may have overriden default values for + ;; As the user may have overridden default values for ;; these vars on `run-python', let-binding them allows ;; to have the new right values in all setup code ;; that's is done in `inferior-python-mode', which is === modified file 'lisp/textmodes/tex-mode.el' --- lisp/textmodes/tex-mode.el 2014-02-10 01:34:22 +0000 +++ lisp/textmodes/tex-mode.el 2014-07-27 11:38:59 +0000 @@ -808,7 +808,7 @@ (defvar tex-verbatim-face 'tex-verbatim) (defun tex-font-lock-verb (start delim) - "Place syntax table properties on the \verb construct. + "Place syntax table properties on the \\verb construct. START is the position of the \\ and DELIM is the delimiter char." ;; Do nothing if the \verb construct is itself inside a comment or ;; verbatim env. === modified file 'lisp/vc/vc-hooks.el' --- lisp/vc/vc-hooks.el 2014-04-20 23:24:04 +0000 +++ lisp/vc/vc-hooks.el 2014-07-28 09:39:09 +0000 @@ -633,8 +633,15 @@ (throw 'found trial)))) templates)))) -(define-obsolete-function-alias - 'vc-toggle-read-only 'toggle-read-only "24.1") + +;; toggle-read-only is obsolete since 24.3, but since vc-t-r-o was made +;; obsolete earlier, it is ok for the latter to be an alias to the former, +;; since the latter will be removed first. We can't just make it +;; an alias for read-only-mode, since that is not 100% the same. +(defalias 'vc-toggle-read-only 'toggle-read-only) +(make-obsolete 'vc-toggle-read-only + "use `read-only-mode' instead (or `toggle-read-only' in older versions of Emacs)." + "24.1") (defun vc-default-make-version-backups-p (_backend _file) "Return non-nil if unmodified versions should be backed up locally. === modified file 'lisp/window.el' --- lisp/window.el 2014-07-27 13:21:30 +0000 +++ lisp/window.el 2014-07-28 09:39:09 +0000 @@ -2286,7 +2286,7 @@ window widths from pixel widths." (setq frame (window-normalize-frame frame)) (let* ((char-size (frame-char-size frame horizontal)) - (root (frame-root-window)) + (root (frame-root-window frame)) (root-size (window-size root horizontal t)) ;; We have to care about the minibuffer window only if it ;; appears together with the root window on this frame. === modified file 'src/.gdbinit' --- src/.gdbinit 2014-07-28 07:17:22 +0000 +++ src/.gdbinit 2014-07-28 09:39:09 +0000 @@ -820,15 +820,7 @@ xgetptr $ print (struct window *) $ptr set $window = (struct window *) $ptr - xgetint $window->total_cols - set $width=$int - xgetint $window->total_lines - set $height=$int - xgetint $window->left_col - set $left=$int - xgetint $window->top_line - set $top=$int - printf "%dx%d+%d+%d\n", $width, $height, $left, $top + printf "%dx%d+%d+%d\n", $window->total_cols, $window->total_lines, $window->left_col, $window->top_line end document xwindow Print $ as a window pointer, assuming it is an Emacs Lisp window value. === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-28 08:07:55 +0000 +++ src/ChangeLog 2014-07-28 09:39:09 +0000 @@ -1,5 +1,9 @@ 2014-07-28 Eli Zaretskii + * .gdbinit (xwindow): The members total_cols, total_lines, + left_col, and top_line are C integers (and has been so for the + last 1.5 years). + * .gdbinit (xsubchartable): The members 'depth' and 'min_char' are now C integers. @@ -4479,7 +4483,7 @@ Avoid undefined behavior with huge regexp interval counts. * regex.c (GET_INTERVAL_COUNT): Rename from 'GET_UNSIGNED_NUMBER', since it's now specialized to interval counts. All uses changed. - Do not assume wrapraound on signed integer overflow. + Do not assume wraparound on signed integer overflow. (regex_compile): Simplify based on the above changes. 2013-12-12 Eli Zaretskii === modified file 'src/dispnew.c' --- src/dispnew.c 2014-07-27 13:21:30 +0000 +++ src/dispnew.c 2014-07-28 09:39:09 +0000 @@ -1638,7 +1638,7 @@ /* Actually change matrices, if allowed. Do not consider CHANGED_LEAF_MATRIX computed above here because the pool - may have been changed which we don't now here. We trust + may have been changed which we don't know here. We trust that we only will be called with DIM_ONLY_P when necessary. */ if (!dim_only_p) === modified file 'src/window.c' --- src/window.c 2014-07-27 13:21:30 +0000 +++ src/window.c 2014-07-28 09:39:09 +0000 @@ -3854,7 +3854,7 @@ } -/* Set w->pixel_height (w->pixel_height if HORIZONTAL is non-zero) to +/* Set w->pixel_height (w->pixel_width if HORFLAG is non-zero) to w->new_pixel for window W and recursively all child windows of W. Also calculate and assign the new vertical (horizontal) pixel start positions of each of these windows. @@ -3944,7 +3944,7 @@ } -/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to +/* Set w->total_lines (w->total_cols if HORFLAG is non-zero) to w->new_total for window W and recursively all child windows of W. Also calculate and assign the new vertical (horizontal) start positions of each of these windows. */ === modified file 'test/automated/python-tests.el' --- test/automated/python-tests.el 2014-07-20 18:12:30 +0000 +++ test/automated/python-tests.el 2014-07-21 14:41:19 +0000 @@ -1807,7 +1807,7 @@ (kill-buffer shell-buffer)))) (ert-deftest python-shell-make-comint-3 () - "Check comint creation with overriden python interpreter and args. + "Check comint creation with overridden python interpreter and args. The command passed to `python-shell-make-comint' as argument must locally override global values set in `python-shell-interpreter' and `python-shell-interpreter-args' in the new shell buffer." ------------------------------------------------------------ revno: 117599 author: Stephen Berman committer: Tassilo Horn branch nick: trunk timestamp: Mon 2014-07-28 11:07:56 +0200 message: Open doc text also if it's not saved to a file. * doc-view.el (doc-view-open-text): Don't require that the document is saved in a file (e.g., email attachment). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-28 04:32:28 +0000 +++ lisp/ChangeLog 2014-07-28 09:07:56 +0000 @@ -1,3 +1,8 @@ +2014-07-28 Stephen Berman + + * doc-view.el (doc-view-open-text): Don't require that the + document is saved in a file (e.g., email attachment). + 2014-07-28 Fabián Ezequiel Gallina Parse completion input in a iPython friendly way. (Bug#18084) === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2014-05-14 17:15:15 +0000 +++ lisp/doc-view.el 2014-07-28 09:07:56 +0000 @@ -1396,11 +1396,12 @@ (interactive) (if doc-view--current-converter-processes (message "DocView: please wait till conversion finished.") - (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))) + (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir))) + (bname (or buffer-file-name (buffer-name)))) (if (file-readable-p txt) (let ((name (concat "Text contents of " - (file-name-nondirectory buffer-file-name))) - (dir (file-name-directory buffer-file-name))) + (file-name-nondirectory bname))) + (dir (or (file-name-directory bname) default-directory))) (with-current-buffer (find-file txt) (rename-buffer name) (setq default-directory dir))) ------------------------------------------------------------ revno: 117598 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2014-07-28 12:07:55 +0400 message: Fix --without-x build and pacify --enable-gcc-warnings. Problems reported in Bug#18122 and Bug#18124. * frame.c (get_frame_param): Define even if !HAVE_WINDOW_SYSTEM. (frame_windows_min_size): Now static. * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS) [!HAVE_WINDOW_SYSTEM]: Define as no-op. (adjust_frame_size): Always declare prototype. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-28 07:17:22 +0000 +++ src/ChangeLog 2014-07-28 08:07:55 +0000 @@ -23,6 +23,14 @@ * lisp.h (add_timer_wait_descriptor) [HAVE_TIMERFD]: Likewise. * process.c (add_timer_wait_descriptor) [HAVE_TIMERFD]: New function. + Fix --without-x build and pacify --enable-gcc-warnings. + Problems reported in Bug#18122 and Bug#18124. + * frame.c (get_frame_param): Define even if !HAVE_WINDOW_SYSTEM. + (frame_windows_min_size): Now static. + * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS) [!HAVE_WINDOW_SYSTEM]: + Define as no-op. + (adjust_frame_size): Always declare prototype. + 2014-07-28 Paul Eggert * frame.c (x_set_frame_parameters): Don't use uninitialized locals. === modified file 'src/frame.c' --- src/frame.c 2014-07-28 02:13:11 +0000 +++ src/frame.c 2014-07-28 08:07:55 +0000 @@ -194,9 +194,8 @@ : "Window system is not in use or not initialized"); } - /* Return the value of frame parameter PROP in frame FRAME. */ -#ifdef HAVE_WINDOW_SYSTEM + Lisp_Object get_frame_param (register struct frame *frame, Lisp_Object prop) { @@ -207,8 +206,6 @@ return tem; return Fcdr (tem); } -#endif - /* Return 1 if `frame-inhibit-implied-resize' is non-nil or fullscreen state of frame F would be affected by a vertical (horizontal if @@ -367,7 +364,7 @@ return type; } -int +static int frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object pixelwise) { return XINT (call3 (Qframe_windows_min_size, frame, horizontal, pixelwise)); === modified file 'src/frame.h' --- src/frame.h 2014-07-27 13:21:30 +0000 +++ src/frame.h 2014-07-28 08:07:55 +0000 @@ -866,6 +866,7 @@ #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((void) f, 0) #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) ((void) f, 0) #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) ((void) f, 0) +#define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) ((void) f, 0) #endif /* HAVE_WINDOW_SYSTEM */ @@ -1108,6 +1109,7 @@ extern void frame_make_pointer_visible (struct frame *); extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object); extern bool frame_inhibit_resize (struct frame *, bool); +extern void adjust_frame_size (struct frame *, int, int, int, bool); extern Lisp_Object Vframe_list; @@ -1376,10 +1378,6 @@ /* The class of this X application. */ #define EMACS_CLASS "Emacs" -/* If these are not in frame.c they are in xterm.c, w32term.c, etc. */ -extern void adjust_frame_size (struct frame *, int, int, int, bool); -extern int frame_windows_min_size (Lisp_Object, Lisp_Object, Lisp_Object); - extern void x_set_scroll_bar_default_width (struct frame *); extern void x_set_scroll_bar_default_height (struct frame *); extern void x_set_offset (struct frame *, int, int, int); ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.