Now on revision 111845. ------------------------------------------------------------ revno: 111845 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-20 22:55:19 -0800 message: Make Info-edit obsolete Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00374.html (Warning: interminable bikeshedding in thread) * lisp/info.el (Info-enable-edit): Remove. (Info-edit): Disable it rather than using Info-enable. (Info-edit-mode-hook, Info-edit-map, Info-edit-mode, Info-edit) (Info-cease-edit): Make editing of Info files obsolete. * etc/NEWS: Mention this. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-02-21 06:03:02 +0000 +++ etc/NEWS 2013-02-21 06:55:19 +0000 @@ -218,6 +218,10 @@ +++ *** yow.el is obsolete; use fortune.el or cookie1.el instead. +--- +*** The Info-edit command is obsolete. Editing Info nodes by hand +has not been relevant for some time. + * New Modes and Packages in Emacs 24.4 ** New nadvice.el package offering lighter-weight advice facilities. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-21 06:39:04 +0000 +++ lisp/ChangeLog 2013-02-21 06:55:19 +0000 @@ -1,5 +1,10 @@ 2013-02-21 Glenn Morris + * info.el (Info-enable-edit): Remove. + (Info-edit): Disable it rather than using Info-enable. + (Info-edit-mode-hook, Info-edit-map, Info-edit-mode, Info-edit) + (Info-cease-edit): Make editing of Info files obsolete. + * informat.el (Info-tagify): Handle buffers not visiting files. (Bug#13763) === modified file 'lisp/info.el' --- lisp/info.el 2013-02-14 09:15:55 +0000 +++ lisp/info.el 2013-02-21 06:55:19 +0000 @@ -59,15 +59,6 @@ :group 'info :version "24.1") -(defcustom Info-enable-edit nil - "Non-nil means the \\\\[Info-edit] command in Info can edit the current node. -This is convenient if you want to write Info files by hand. -However, we recommend that you not do this. -It is better to write a Texinfo file and generate the Info file from that, -because that gives you a printed manual as well." - :type 'boolean - :group 'info) - (defvar Info-enable-active-nodes nil "Non-nil allows Info to execute Lisp code associated with nodes. The Lisp code is executed when the node is selected.") @@ -375,6 +366,9 @@ (defvar Info-edit-mode-hook nil "Hooks run when `Info-edit-mode' is called.") +(make-obsolete-variable 'Info-edit-mode-hook + "editing Info nodes by hand is not recommended." "24.4") + (defvar Info-current-file nil "Info file that Info is now looking at, or nil. This is the name that was specified in Info, not the actual file name. @@ -4253,6 +4247,10 @@ map) "Local keymap used within `e' command of Info.") +(make-obsolete-variable 'Info-edit-map + "editing Info nodes by hand is not recommended." + "24.4") + ;; Info-edit mode is suitable only for specially formatted data. (put 'Info-edit-mode 'mode-class 'special) @@ -4270,16 +4268,22 @@ (buffer-enable-undo (current-buffer)) (run-mode-hooks 'Info-edit-mode-hook)) +(make-obsolete 'Info-edit-mode + "editing Info nodes by hand is not recommended." "24.4") + (defun Info-edit () - "Edit the contents of this Info node. -Allowed only if variable `Info-enable-edit' is non-nil." + "Edit the contents of this Info node." (interactive) - (or Info-enable-edit - (error "Editing Info nodes is not enabled")) (Info-edit-mode) (message "%s" (substitute-command-keys "Editing: Type \\\\[Info-cease-edit] to return to info"))) +(put 'Info-edit 'disabled "Editing Info nodes by hand is not recommended. +This feature will be removed in future.") + +(make-obsolete 'Info-edit + "editing Info nodes by hand is not recommended." "24.4") + (defun Info-cease-edit () "Finish editing Info node; switch back to Info proper." (interactive) @@ -4296,6 +4300,9 @@ (and (marker-position Info-tag-table-marker) (buffer-modified-p) (message "Tags may have changed. Use Info-tagify if necessary"))) + +(make-obsolete 'Info-cease-edit + "editing Info nodes by hand is not recommended." "24.4") (defvar Info-file-list-for-emacs '("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e") ------------------------------------------------------------ revno: 111844 fixes bug: http://debbugs.gnu.org/13763 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-20 22:39:04 -0800 message: * lisp/informat.el (Info-tagify): Handle buffers not visiting files. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-21 04:27:05 +0000 +++ lisp/ChangeLog 2013-02-21 06:39:04 +0000 @@ -1,3 +1,8 @@ +2013-02-21 Glenn Morris + + * informat.el (Info-tagify): + Handle buffers not visiting files. (Bug#13763) + 2013-02-21 Juanma Barranquero * calc/calc-graph.el (calc-graph-show-dumb): Fix typo. === modified file 'lisp/informat.el' --- lisp/informat.el 2013-01-01 09:11:05 +0000 +++ lisp/informat.el 2013-02-21 06:39:04 +0000 @@ -43,14 +43,17 @@ ;; save-restrictions would not work ;; because it records the old max relative to the end. ;; We record it relative to the beginning. - (if input-buffer-name - (message "Tagifying region in %s ..." input-buffer-name) - (message - "Tagifying %s ..." (file-name-nondirectory (buffer-file-name)))) (let ((omin (point-min)) (omax (point-max)) (nomax (= (point-max) (1+ (buffer-size)))) - (opoint (point))) + (opoint (point)) + (msg (format "Tagifying %s..." + (cond (input-buffer-name + (format "region in %s" input-buffer-name)) + (buffer-file-name + (file-name-nondirectory (buffer-file-name))) + (t "buffer"))))) + (message "%s" msg) (unwind-protect (progn (widen) @@ -148,11 +151,8 @@ (insert "\^_\nEnd tag table\n"))))) (goto-char opoint) (narrow-to-region omin (if nomax (1+ (buffer-size)) - (min omax (point-max)))))) - (if input-buffer-name - (message "Tagifying region in %s done" input-buffer-name) - (message - "Tagifying %s done" (file-name-nondirectory (buffer-file-name))))) + (min omax (point-max))))) + (message "%sdone" msg))) ;;;###autoload ------------------------------------------------------------ revno: 111843 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-20 22:03:02 -0800 message: More doc updates for multi-frame images * doc/emacs/files.texi (File Conveniences): Not just GIFs can be animated. * doc/lispref/display.texi (Multi-Frame Images): Minor rephrasing. * etc/NEWS: Related edits. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-02-13 08:50:44 +0000 +++ doc/emacs/ChangeLog 2013-02-21 06:03:02 +0000 @@ -1,3 +1,7 @@ +2013-02-21 Glenn Morris + + * files.texi (File Conveniences): Not just GIFs can be animated. + 2013-02-13 Glenn Morris * ack.texi (Acknowledgments): Don't mention yow any more. === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2013-01-01 09:11:05 +0000 +++ doc/emacs/files.texi 2013-02-21 06:03:02 +0000 @@ -1937,8 +1937,7 @@ displayed. If the image can be animated, the command @kbd{RET} (@code{image-toggle-animation}) starts or stops the animation. Animation plays once, unless the option @code{image-animate-loop} is -non-@code{nil}. Currently, Emacs only supports animation in GIF -files. +non-@code{nil}. @cindex ImageMagick support @vindex imagemagick-enabled-types === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-02-20 08:34:28 +0000 +++ doc/lispref/ChangeLog 2013-02-21 06:03:02 +0000 @@ -1,3 +1,7 @@ +2013-02-21 Glenn Morris + + * display.texi (Multi-Frame Images): Minor rephrasing. + 2013-02-20 Glenn Morris * display.texi (GIF Images, TIFF Images): Delete these nodes. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2013-02-20 08:34:28 +0000 +++ doc/lispref/display.texi 2013-02-21 06:03:02 +0000 @@ -4925,10 +4925,10 @@ This function returns non-@code{nil} if @var{image} contains more than one frame. The actual return value is a cons @code{(@var{nimages} . @var{delay})}, where @var{nimages} is the number of frames and -@var{delay} is the delay in seconds between them, if the image itself -specifies a delay. Images that are intended to be animated usually -specify a frame delay, whereas ones that are intended to be treated as -multiple pages do not. +@var{delay} is the delay in seconds between them, or @code{nil} +if the image does not specify a delay. Images that are intended to be +animated usually specify a frame delay, whereas ones that are intended +to be treated as multiple pages do not. @end defun @defun image-current-frame image === modified file 'etc/NEWS' --- etc/NEWS 2013-02-16 19:56:50 +0000 +++ etc/NEWS 2013-02-21 06:03:02 +0000 @@ -145,8 +145,6 @@ `f' (`image-next-frame') and `b' (`image-previous-frame') visit the next or previous frame. `F' (`image-goto-frame') shows a specific frame. -*** `image-animated-p' is now `image-multi-frame-p'. - --- *** The command `image-mode-fit-frame' deletes other windows. When toggling, it restores the frame's previous window configuration. @@ -291,6 +289,21 @@ *** New face characteristic (supports :underline (:style wave)) specifies whether or not the terminal can display a wavy line. +** Image API + ++++ +*** `image-animated-p' is now `image-multi-frame-p'. +It returns non-nil for any image that contains multiple frames, +whether or not it specifies a frame delay. + ++++ +*** When animating images that do not specify a frame delay, +Emacs uses `image-default-frame-delay'. + ++++ +*** New functions `image-current-frame' and `image-show-frame' for getting +and setting the current frame of a multi-frame image. + ** time-to-seconds is not obsolete any more. ** New function special-form-p. ** Docstrings can be made dynamic by adding a `dynamic-docstring-function' ------------------------------------------------------------ revno: 111842 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2013-02-21 05:27:05 +0100 message: lisp/calc/calc-graph.el (calc-graph-show-dumb): Fix typo. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-21 02:44:06 +0000 +++ lisp/ChangeLog 2013-02-21 04:27:05 +0000 @@ -1,3 +1,7 @@ +2013-02-21 Juanma Barranquero + + * calc/calc-graph.el (calc-graph-show-dumb): Fix typo. + 2013-02-21 Glenn Morris * files.el (basic-save-buffer): Move check for existing parent === modified file 'lisp/calc/calc-graph.el' --- lisp/calc/calc-graph.el 2013-02-12 04:46:18 +0000 +++ lisp/calc/calc-graph.el 2013-02-21 04:27:05 +0000 @@ -948,7 +948,7 @@ (setq calc-dumb-map (make-sparse-keymap)) (define-key calc-dumb-map "\n" 'scroll-up-command) (define-key calc-dumb-map " " 'scroll-up-command) - (define-key calc-dump-map [?\S-\ ] 'scroll-down-command) + (define-key calc-dumb-map [?\S-\ ] 'scroll-down-command) (define-key calc-dumb-map "\177" 'scroll-down-command) (define-key calc-dumb-map "<" 'scroll-left) (define-key calc-dumb-map ">" 'scroll-right) ------------------------------------------------------------ revno: 111841 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-20 21:44:06 -0500 message: * lisp/files.el (basic-save-buffer): Move check for existing parent directory after hooks. (Bug#13773) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-20 16:37:06 +0000 +++ lisp/ChangeLog 2013-02-21 02:44:06 +0000 @@ -1,3 +1,8 @@ +2013-02-21 Glenn Morris + + * files.el (basic-save-buffer): Move check for existing parent + directory after hooks. (Bug#13773) + 2013-02-20 Stefan Monnier * simple.el (command-execute): Move from C. Add obsolete check. === modified file 'lisp/files.el' --- lisp/files.el 2013-02-12 08:36:09 +0000 +++ lisp/files.el 2013-02-21 02:44:06 +0000 @@ -4563,15 +4563,8 @@ (not (file-exists-p buffer-file-name)))) (let ((recent-save (recent-auto-save-p)) setmodes) - (if buffer-file-name - (let ((dir (file-name-directory - (expand-file-name buffer-file-name)))) - (unless (file-exists-p dir) - (if (y-or-n-p - (format "Directory `%s' does not exist; create? " dir)) - (make-directory dir t) - (error "Canceled")))) ;; If buffer has no file name, ask user for one. + (or buffer-file-name (let ((filename (expand-file-name (read-file-name "File to save in: " @@ -4628,7 +4621,14 @@ (run-hook-with-args-until-success 'write-file-functions) ;; If a hook returned t, file is already "written". ;; Otherwise, write it the usual way now. - (setq setmodes (basic-save-buffer-1))) + (let ((dir (file-name-directory + (expand-file-name buffer-file-name)))) + (unless (file-exists-p dir) + (if (y-or-n-p + (format "Directory `%s' does not exist; create? " dir)) + (make-directory dir t) + (error "Canceled"))) + (setq setmodes (basic-save-buffer-1)))) ;; Now we have saved the current buffer. Let's make sure ;; that buffer-file-coding-system is fixed to what ;; actually used for saving by binding it locally. ------------------------------------------------------------ revno: 111840 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-02-20 18:42:30 -0800 message: Port documentation to Texinfo 5.0. diff: === modified file 'doc/lispintro/emacs-lisp-intro.texi' --- doc/lispintro/emacs-lisp-intro.texi 2013-01-02 16:13:04 +0000 +++ doc/lispintro/emacs-lisp-intro.texi 2013-02-21 02:42:30 +0000 @@ -4583,7 +4583,7 @@ @item buffer-name Without an argument, return the name of the buffer, as a string. -@itemx buffer-file-name +@item buffer-file-name Without an argument, return the name of the file the buffer is visiting. === modified file 'doc/misc/eshell.texi' --- doc/misc/eshell.texi 2013-02-18 18:27:51 +0000 +++ doc/misc/eshell.texi 2013-02-21 02:42:30 +0000 @@ -83,8 +83,8 @@ * GNU Free Documentation License:: The license for this documentation. * Concept Index:: * Function and Variable Index:: +* Command Index:: * Key Index:: -* Command Index:: @end menu @node What is Eshell? @@ -285,8 +285,8 @@ @menu * Invocation:: * Arguments:: +* Built-ins:: * Variables:: -* Built-ins:: * Aliases:: * History:: * Completion:: @@ -465,7 +465,7 @@ @end table -@section Built-in variables +@subsection Built-in variables Eshell knows a few built-in variables: @table @code === modified file 'doc/misc/gnus-faq.texi' --- doc/misc/gnus-faq.texi 2013-02-12 17:36:54 +0000 +++ doc/misc/gnus-faq.texi 2013-02-21 02:42:30 +0000 @@ -3,8 +3,8 @@ @c %**start of header @c Copyright (C) 1995, 2001-2013 Free Software Foundation, Inc. @c -@setfilename gnus-faq.info -@settitle Frequently Asked Questions +@c @setfilename gnus-faq.info +@c @settitle Frequently Asked Questions @c %**end of header @c @@ -41,7 +41,7 @@ @email{ding@@gnus.org, ding list}. @node FAQ - Changes -@subheading Changes +@subsection Changes @@ -57,7 +57,7 @@ @end itemize @node FAQ - Introduction -@subheading Introduction +@subsection Introduction This is the Gnus Frequently Asked Questions list. === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2013-02-13 04:31:09 +0000 +++ doc/misc/gnus.texi 2013-02-21 02:42:30 +0000 @@ -14541,6 +14541,7 @@ @menu * Mail Source Specifiers:: How to specify what a mail source is. +* Mail Source Functions:: * Mail Source Customization:: Some variables that influence things. * Fetching Mail:: Using the mail source specifiers. @end menu @@ -15000,6 +15001,7 @@ @end table @end table +@node Mail Source Functions @subsubsection Function Interface Some of the above keywords specify a Lisp function to be executed. @@ -16068,6 +16070,10 @@ * Mail Spool:: Store your mail in a private spool? * MH Spool:: An mhspool-like back end. * Maildir:: Another one-file-per-message format. +* nnmaildir Group Parameters:: +* Article Identification:: +* NOV Data:: +* Article Marks:: * Mail Folders:: Having one file for each group. * Comparing Mail Back Ends:: An in-depth looks at pros and cons. @end menu @@ -16375,6 +16381,7 @@ remember to supply a @code{create-directory} server parameter. @end table +@node nnmaildir Group Parameters @subsubsection Group parameters @code{nnmaildir} uses several group parameters. It's safe to ignore @@ -16485,6 +16492,7 @@ @code{read}, plus a little extra. @end table +@node Article Identification @subsubsection Article identification Articles are stored in the @file{cur/} subdirectory of each maildir. Each article file is named like @code{uniq:info}, where @code{uniq} @@ -16497,6 +16505,7 @@ available in the variable @code{nnmaildir-article-file-name} after you request the article in the summary buffer. +@node NOV Data @subsubsection NOV data An article identified by @code{uniq} has its @acronym{NOV} data (used to generate lines in the summary buffer) stored in @@ -16510,6 +16519,7 @@ assign a new article number for this article, which may cause trouble with @code{seen} marks, the Agent, and the cache. +@node Article Marks @subsubsection Article marks An article identified by @code{uniq} is considered to have the mark @code{flag} when the file @file{.nnmaildir/marks/flag/uniq} exists. @@ -25850,8 +25860,8 @@ @menu * Gnus Registry Setup:: +* Registry Article Refer Method:: * Fancy splitting to parent:: -* Registry Article Refer Method:: * Store custom flags and keywords:: * Store arbitrary data:: @end menu === modified file 'doc/misc/semantic.texi' --- doc/misc/semantic.texi 2013-01-01 09:11:05 +0000 +++ doc/misc/semantic.texi 2013-02-21 02:42:30 +0000 @@ -520,7 +520,7 @@ @node Glossary @appendix Glossary -@table @keyword +@table @asis @item BNF In semantic 1.4, a BNF file represented ``Bovine Normal Form'', the grammar file used for the 1.4 parser generator. This was a play on === modified file 'doc/misc/speedbar.texi' --- doc/misc/speedbar.texi 2013-02-13 04:31:09 +0000 +++ doc/misc/speedbar.texi 2013-02-21 02:42:30 +0000 @@ -223,7 +223,7 @@ to read these textual elements will make it easier to navigate by identifying the types of data available. -@subsubsection Groups +@subsection Groups @cindex groups Groups summarize information in a single line, and provide a high level === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2013-02-20 14:49:52 +0000 +++ doc/misc/tramp.texi 2013-02-21 02:42:30 +0000 @@ -144,9 +144,6 @@ * Usage:: An overview of the operation of @value{tramp}. * Bug Reports:: Reporting Bugs and Problems. * Frequently Asked Questions:: Questions and answers from the mailing list. -* Function Index:: @value{tramp} functions. -* Variable Index:: User options and variables. -* Concept Index:: An item for each concept. For the developer: @@ -155,6 +152,9 @@ * Issues:: Debatable Issues and What Was Decided. * GNU Free Documentation License:: The license for this documentation. +* Function Index:: @value{tramp} functions. +* Variable Index:: User options and variables. +* Concept Index:: An item for each concept. @detailmenu --- The Detailed Node Listing --- ------------------------------------------------------------ revno: 111839 committer: Ken Brown branch nick: trunk timestamp: Wed 2013-02-20 21:35:33 -0500 message: * src/sheap.c (report_sheap_usage): Fix arguments of message1_no_log. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-20 21:02:37 +0000 +++ src/ChangeLog 2013-02-21 02:35:33 +0000 @@ -1,3 +1,7 @@ +2013-02-21 Ken Brown + + * sheap.c (report_sheap_usage): Fix arguments of message1_no_log. + 2013-02-20 Stefan Monnier * sheap.c (report_sheap_usage): Prefer message1_nolog. === modified file 'src/sheap.c' --- src/sheap.c 2013-02-20 21:02:37 +0000 +++ src/sheap.c 2013-02-21 02:35:33 +0000 @@ -93,5 +93,5 @@ bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); /* Don't log messages, cause at this point, we're not allowed to create buffers. */ - message1_nolog ("%s", buf); + message1_nolog (buf); } ------------------------------------------------------------ revno: 111838 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-02-20 16:02:37 -0500 message: * src/sheap.c (report_sheap_usage): Prefer message1_nolog. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-20 16:37:06 +0000 +++ src/ChangeLog 2013-02-20 21:02:37 +0000 @@ -1,5 +1,7 @@ 2013-02-20 Stefan Monnier + * sheap.c (report_sheap_usage): Prefer message1_nolog. + * keyboard.c (Qcommand_execute): New var. (command_loop_1, read_char): Use it. (Fcommand_execute): Remove, replace by an Elisp implementation. === modified file 'src/sheap.c' --- src/sheap.c 2013-02-20 05:43:53 +0000 +++ src/sheap.c 2013-02-20 21:02:37 +0000 @@ -91,8 +91,7 @@ char buf[200]; sprintf (buf, "Static heap usage: %d of %d bytes", bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); - /* Don't change this call to message1! message1 can log - messages, and at this point, we're not allowed to create + /* Don't log messages, cause at this point, we're not allowed to create buffers. */ - message ("%s", buf); + message1_nolog ("%s", buf); } ------------------------------------------------------------ revno: 111837 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-02-20 11:37:06 -0500 message: * lisp/simple.el (command-execute): Move from C. Add obsolete check. (extended-command-history): Move from C. * src/keyboard.c (Qcommand_execute): New var. (command_loop_1, read_char): Use it. (Fcommand_execute): Remove, replace by an Elisp implementation. (syms_of_keyboard): Adjust accordingly. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-20 14:30:23 +0000 +++ lisp/ChangeLog 2013-02-20 16:37:06 +0000 @@ -1,3 +1,8 @@ +2013-02-20 Stefan Monnier + + * simple.el (command-execute): Move from C. Add obsolete check. + (extended-command-history): Move from C. + 2013-02-20 Ulrich Müller * jka-cmpr-hook.el (jka-compr-compression-info-list) === modified file 'lisp/simple.el' --- lisp/simple.el 2013-02-15 23:47:50 +0000 +++ lisp/simple.el 2013-02-20 16:37:06 +0000 @@ -1400,6 +1400,8 @@ (error "Argument %d is beyond length of command history" arg) (error "There are no previous complex commands to repeat"))))) +(defvar extended-command-history nil) + (defun read-extended-command () "Read command name to invoke in `execute-extended-command'." (minibuffer-with-setup-hook @@ -1489,6 +1491,53 @@ (sit-for (if (numberp suggest-key-bindings) suggest-key-bindings 2)))))))) + +(defun command-execute (cmd &optional record-flag keys special) + ;; BEWARE: Called directly from the C code. + "Execute CMD as an editor command. +CMD must be a symbol that satisfies the `commandp' predicate. +Optional second arg RECORD-FLAG non-nil +means unconditionally put this command in the variable `command-history'. +Otherwise, that is done only if an arg is read using the minibuffer. +The argument KEYS specifies the value to use instead of (this-command-keys) +when reading the arguments; if it is nil, (this-command-keys) is used. +The argument SPECIAL, if non-nil, means that this command is executing +a special event, so ignore the prefix argument and don't clear it." + (setq debug-on-next-call nil) + (let ((prefixarg (unless special + (prog1 prefix-arg + (setq current-prefix-arg prefix-arg) + (setq prefix-arg nil))))) + (and (symbolp cmd) + (get cmd 'disabled) + ;; FIXME: Weird calling convention! + (run-hooks 'disabled-command-function)) + (let ((final cmd)) + (while + (progn + (setq final (indirect-function final)) + (if (autoloadp final) + (setq final (autoload-do-load final cmd))))) + (cond + ((arrayp final) + ;; If requested, place the macro in the command history. For + ;; other sorts of commands, call-interactively takes care of this. + (when record-flag + (push `(execute-kbd-macro ,final ,prefixarg) command-history) + ;; Don't keep command history around forever. + (when (and (numberp history-length) (> history-length 0)) + (let ((cell (nthcdr history-length command-history))) + (if (consp cell) (setcdr cell nil))))) + (execute-kbd-macro final prefixarg)) + (t + ;; Pass `cmd' rather than `final', for the backtrace's sake. + (prog1 (call-interactively cmd record-flag keys) + (when (and (symbolp cmd) + (get cmd 'byte-obsolete-info) + (not (get cmd 'command-execute-obsolete-warned))) + (put cmd 'command-execute-obsolete-warned t) + (message "%s" (macroexp--obsolete-warning + cmd (get cmd 'byte-obsolete-info) "command"))))))))) (defvar minibuffer-history nil "Default minibuffer history list. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-20 05:56:28 +0000 +++ src/ChangeLog 2013-02-20 16:37:06 +0000 @@ -1,12 +1,21 @@ +2013-02-20 Stefan Monnier + + * keyboard.c (Qcommand_execute): New var. + (command_loop_1, read_char): Use it. + (Fcommand_execute): Remove, replace by an Elisp implementation. + (syms_of_keyboard): Adjust accordingly. + 2013-02-19 Daniel Colascione + * sheap.c (report_sheap_usage): Use message, not message1, so that we don't try to create a buffer while we're in the middle of dumping Emacs. Explain why. + 2013-02-20 Dmitry Antipov * search.c (find_newline): Return byte position in bytepos. Adjust comment. - (find_next_newline_no_quit, find_before_next_newline): Add - bytepos argument. + (find_next_newline_no_quit, find_before_next_newline): + Add bytepos argument. * lisp.h (find_newline, find_next_newline_no_quit) (find_before_next_newline): Adjust prototypes. * bidi.c (bidi_find_paragraph_start): === modified file 'src/keyboard.c' --- src/keyboard.c 2013-02-17 16:49:27 +0000 +++ src/keyboard.c 2013-02-20 16:37:06 +0000 @@ -367,7 +367,7 @@ static Lisp_Object recursive_edit_unwind (Lisp_Object buffer); static Lisp_Object command_loop (void); -static Lisp_Object Qextended_command_history; +static Lisp_Object Qcommand_execute; EMACS_TIME timer_check (void); static void echo_now (void); @@ -1583,11 +1583,11 @@ = (EQ (undo, BVAR (current_buffer, undo_list)) ? Qnil : BVAR (current_buffer, undo_list)); } - Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil); + call1 (Qcommand_execute, Vthis_command); #ifdef HAVE_WINDOW_SYSTEM /* Do not check display_hourglass_p here, because - Fcommand_execute could change it, but we should cancel + `command-execute' could change it, but we should cancel hourglass cursor anyway. But don't cancel the hourglass within a macro just because a command in the macro finishes. */ @@ -2842,7 +2842,7 @@ { struct buffer *prev_buffer = current_buffer; last_input_event = c; - Fcommand_execute (tem, Qnil, Fvector (1, &last_input_event), Qt); + call4 (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event), Qt); if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) /* We stopped being idle for this event; undo that. This @@ -9876,95 +9876,6 @@ return unbind_to (count, Fvector (i, keybuf)); } -DEFUN ("command-execute", Fcommand_execute, Scommand_execute, 1, 4, 0, - doc: /* Execute CMD as an editor command. -CMD must be a symbol that satisfies the `commandp' predicate. -Optional second arg RECORD-FLAG non-nil -means unconditionally put this command in the variable `command-history'. -Otherwise, that is done only if an arg is read using the minibuffer. -The argument KEYS specifies the value to use instead of (this-command-keys) -when reading the arguments; if it is nil, (this-command-keys) is used. -The argument SPECIAL, if non-nil, means that this command is executing -a special event, so ignore the prefix argument and don't clear it. */) - (Lisp_Object cmd, Lisp_Object record_flag, Lisp_Object keys, Lisp_Object special) -{ - register Lisp_Object final; - register Lisp_Object tem; - Lisp_Object prefixarg; - - debug_on_next_call = 0; - - if (NILP (special)) - { - prefixarg = KVAR (current_kboard, Vprefix_arg); - Vcurrent_prefix_arg = prefixarg; - kset_prefix_arg (current_kboard, Qnil); - } - else - prefixarg = Qnil; - - if (SYMBOLP (cmd)) - { - tem = Fget (cmd, Qdisabled); - if (!NILP (tem)) - { - tem = Fsymbol_value (Qdisabled_command_function); - if (!NILP (tem)) - return Frun_hooks (1, &Qdisabled_command_function); - } - } - - while (1) - { - final = Findirect_function (cmd, Qnil); - - if (CONSP (final) && (tem = Fcar (final), EQ (tem, Qautoload))) - { - struct gcpro gcpro1, gcpro2; - - GCPRO2 (cmd, prefixarg); - Fautoload_do_load (final, cmd, Qnil); - UNGCPRO; - } - else - break; - } - - if (STRINGP (final) || VECTORP (final)) - { - /* If requested, place the macro in the command history. For - other sorts of commands, call-interactively takes care of - this. */ - if (!NILP (record_flag)) - { - Vcommand_history - = Fcons (Fcons (Qexecute_kbd_macro, - Fcons (final, Fcons (prefixarg, Qnil))), - Vcommand_history); - - /* Don't keep command history around forever. */ - if (NUMBERP (Vhistory_length) && XINT (Vhistory_length) > 0) - { - tem = Fnthcdr (Vhistory_length, Vcommand_history); - if (CONSP (tem)) - XSETCDR (tem, Qnil); - } - } - - return Fexecute_kbd_macro (final, prefixarg, Qnil); - } - - if (CONSP (final) || SUBRP (final) || COMPILEDP (final)) - /* Don't call Fcall_interactively directly because we want to make - sure the backtrace has an entry for `call-interactively'. - For the same reason, pass `cmd' rather than `final'. */ - return call3 (Qcall_interactively, cmd, record_flag, keys); - - return Qnil; -} - - - /* Return true if input events are pending. */ bool @@ -11195,8 +11106,7 @@ raw_keybuf = Fmake_vector (make_number (30), Qnil); staticpro (&raw_keybuf); - DEFSYM (Qextended_command_history, "extended-command-history"); - Fset (Qextended_command_history, Qnil); + DEFSYM (Qcommand_execute, "command-execute"); accent_key_syms = Qnil; staticpro (&accent_key_syms); @@ -11235,7 +11145,6 @@ defsubr (&Srecursive_edit); defsubr (&Strack_mouse); defsubr (&Sinput_pending_p); - defsubr (&Scommand_execute); defsubr (&Srecent_keys); defsubr (&Sthis_command_keys); defsubr (&Sthis_command_keys_vector); ------------------------------------------------------------ revno: 111836 committer: Michael Albinus . diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-02-16 17:38:37 +0000 +++ doc/misc/ChangeLog 2013-02-20 14:49:52 +0000 @@ -1,3 +1,8 @@ +2013-02-20 Michael Albinus + + * tramp.texi (Android shell setup): Improve. Reported by Thierry + Volpiatto . + 2013-02-16 Michael Albinus * tramp.texi (Top, Configuration): Insert section `Android shell === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2013-02-19 14:44:03 +0000 +++ doc/misc/tramp.texi 2013-02-20 14:49:52 +0000 @@ -2016,7 +2016,7 @@ When an @command{sshd} process runs on the Android device, like provided by the @code{SSHDroid} app, any @option{ssh}-based method can -be used. However, this requires some special settings. +be used. This requires some special settings. The default shell @code{/bin/sh} does not exist. Instead, you shall use just @code{sh}, which invokes the shell installed on the device. @@ -2031,23 +2031,50 @@ with @samp{192.168.0.26} being the IP address of your Android device. The user settings for the @code{$PATH} environment variable must be -preserved. Add this setting: +preserved. It has also been reported, that the commands in +@file{/system/xbin} are better suited than the ones in +@file{/system/bin}. Add these setting: @lisp (add-to-list 'tramp-remote-path 'tramp-own-remote-path) +(add-to-list 'tramp-remote-path "/system/xbin") @end lisp +@noindent If the Android device is not @samp{rooted}, you must give the shell a -writable directory for temporary files. You could use this setting: +writable directory for temporary files: @lisp (add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME") @end lisp +@noindent Now you shall be able to open a remote connection with @kbd{C-x C-f @trampfn{ssh, , 192.168.0.26#2222, }}, given that @command{sshd} listens on port @samp{2222}. +It is also recommended to add a corresponding entry to your +@file{~/.ssh/config} for that connection, like + +@example +Host android + HostName 192.168.0.26 + User root + Port 2222 +@end example + +@noindent +In this case, you must change the setting for the remote shell to + +@lisp +(add-to-list 'tramp-connection-properties + (list (regexp-quote "android") "remote-shell" "sh")) +@end lisp + +@noindent +You would open the connection with @kbd{C-x C-f @trampfn{ssh, , +android, }} then. + @node Auto-save and Backup @section Auto-save and Backup configuration ------------------------------------------------------------ revno: 111835 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13770 author: Ulrich Müller committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-02-20 09:30:23 -0500 message: * lisp/jka-cmpr-hook.el (jka-compr-compression-info-list) (jka-compr-mode-alist-additions): Handle .txz suffix for XZ-compressed tar archives. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-20 13:05:24 +0000 +++ lisp/ChangeLog 2013-02-20 14:30:23 +0000 @@ -1,7 +1,13 @@ +2013-02-20 Ulrich Müller + + * jka-cmpr-hook.el (jka-compr-compression-info-list) + (jka-compr-mode-alist-additions): Handle .txz suffix for + XZ-compressed tar archives (bug#13770). + 2013-02-20 Bastien Guerry - * outline.el (outline-regexp, outline-heading-end-regexp): Make - variables, not options (bug#13731). + * outline.el (outline-regexp, outline-heading-end-regexp): + Make variables, not options (bug#13731). 2013-02-20 Glenn Morris === modified file 'lisp/jka-cmpr-hook.el' --- lisp/jka-cmpr-hook.el 2013-01-01 09:11:05 +0000 +++ lisp/jka-cmpr-hook.el 2013-02-20 14:30:23 +0000 @@ -234,6 +234,10 @@ "XZ compressing" "xz" ("-c" "-q") "XZ uncompressing" "xz" ("-c" "-q" "-d") t t "\3757zXZ\0"] + ["\\.txz\\'" + "XZ compressing" "xz" ("-c" "-q") + "XZ uncompressing" "xz" ("-c" "-q" "-d") + t nil "\3757zXZ\0"] ;; dzip is gzip with random access. Its compression program can't ;; read/write stdin/out, so .dz files can only be viewed without ;; saving, having their contents decompressed with gzip. @@ -302,7 +306,9 @@ :group 'jka-compr) (defcustom jka-compr-mode-alist-additions - (list (cons (purecopy "\\.tgz\\'") 'tar-mode) (cons (purecopy "\\.tbz2?\\'") 'tar-mode)) + (purecopy '(("\\.tgz\\'" . tar-mode) + ("\\.tbz2?\\'" . tar-mode) + ("\\.txz\\'" . 'tar-mode))) "List of pairs added to `auto-mode-alist' when installing jka-compr. Uninstalling jka-compr removes all pairs from `auto-mode-alist' that installing added. @@ -315,7 +321,7 @@ :set 'jka-compr-set :group 'jka-compr) -(defcustom jka-compr-load-suffixes (list (purecopy ".gz")) +(defcustom jka-compr-load-suffixes (purecopy '(".gz")) "List of compression related suffixes to try when loading files. Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', which see. Disabling Auto Compression mode removes all suffixes ------------------------------------------------------------ revno: 111834 committer: Bastien Guerry branch nick: trunk timestamp: Wed 2013-02-20 14:05:24 +0100 message: * outline.el (outline-regexp, outline-heading-end-regexp): Use variables, not options (bug#13731). Setting this as a global option is likely to be useless, because it is unlikely that all outline file will use the modified regexp. Additionnally, if one of these variables if set through customize and the outline keybindings don't work in a standard outline file, it is hard to know why. Thanks to T. V. Raman for reporting this. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-20 07:57:33 +0000 +++ lisp/ChangeLog 2013-02-20 13:05:24 +0000 @@ -1,3 +1,8 @@ +2013-02-20 Bastien Guerry + + * outline.el (outline-regexp, outline-heading-end-regexp): Make + variables, not options (bug#13731). + 2013-02-20 Glenn Morris * image.el (image-current-frame): Change from variable to function. === modified file 'lisp/outline.el' --- lisp/outline.el 2013-01-01 09:11:05 +0000 +++ lisp/outline.el 2013-02-20 13:05:24 +0000 @@ -43,25 +43,21 @@ :prefix "outline-" :group 'wp) -(defcustom outline-regexp "[*\^L]+" +(defvar outline-regexp "[*\^L]+" "Regular expression to match the beginning of a heading. Any line whose beginning matches this regexp is considered to start a heading. Note that Outline mode only checks this regexp at the start of a line, so the regexp need not (and usually does not) start with `^'. The recommended way to set this is with a Local Variables: list -in the file it applies to. See also `outline-heading-end-regexp'." - :type 'regexp - :group 'outlines) +in the file it applies to. See also `outline-heading-end-regexp'.") ;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp) -(defcustom outline-heading-end-regexp "\n" +(defvar outline-heading-end-regexp "\n" "Regular expression to match the end of a heading line. You can assume that point is at the beginning of a heading when this regexp is searched for. The heading ends at the end of the match. The recommended way to set this is with a `Local Variables:' list -in the file it applies to." - :type 'regexp - :group 'outlines) +in the file it applies to.") ;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp) (defvar outline-mode-prefix-map ------------------------------------------------------------ revno: 111833 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-20 00:34:28 -0800 message: Lispref updates for multi-frame images * doc/lispref/display.texi (GIF Images, TIFF Images): Delete these nodes. (ImageMagick Images): For :index, use an xref rather than duplicating. (Other Image Types): Add GIF, adjust formatting. (Multi-Frame Images): Rename from Animated Images. Expand section. * doc/lispref/elisp.texi (Top): Update menu for these changes. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-02-19 03:29:28 +0000 +++ doc/lispref/ChangeLog 2013-02-20 08:34:28 +0000 @@ -1,3 +1,11 @@ +2013-02-20 Glenn Morris + + * display.texi (GIF Images, TIFF Images): Delete these nodes. + (ImageMagick Images): For :index, use an xref rather than duplicating. + (Other Image Types): Add GIF, adjust formatting. + (Multi-Frame Images): Rename from Animated Images. Expand section. + * elisp.texi (Top): Update menu for these changes. + 2013-02-19 Glenn Morris * text.texi (Change Hooks): Fix typo. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2013-01-05 21:18:01 +0000 +++ doc/lispref/display.texi 2013-02-20 08:34:28 +0000 @@ -4199,14 +4199,12 @@ * Image Descriptors:: How to specify an image for use in @code{:display}. * XBM Images:: Special features for XBM format. * XPM Images:: Special features for XPM format. -* GIF Images:: Special features for GIF format. -* TIFF Images:: Special features for TIFF format. * PostScript Images:: Special features for PostScript format. * ImageMagick Images:: Special features available through ImageMagick. * Other Image Types:: Various other formats are supported. * Defining Images:: Convenient ways to define an image for later use. * Showing Images:: Convenient ways to display an image once it is defined. -* Animated Images:: Some image formats can be animated. +* Multi-Frame Images:: Some images contain more than one frame. * Image Cache:: Internal mechanisms of image display. @end menu @@ -4541,35 +4539,6 @@ specifies the actual color to use for displaying that name. @end table -@node GIF Images -@subsection GIF Images -@cindex GIF - - For GIF images, specify image type @code{gif}. - -@table @code -@item :index @var{index} -You can use @code{:index} to specify image number @var{index} from a -GIF file that contains more than one image. If the GIF file doesn't -contain an image with the specified index, the image displays as a -hollow box. GIF files with more than one image can be animated, -@pxref{Animated Images}. -@end table - -@node TIFF Images -@subsection TIFF Images -@cindex TIFF - - For TIFF images, specify image type @code{tiff}. - -@table @code -@item :index @var{index} -You can use @code{:index} to specify image number @var{index} from a -TIFF file that contains more than one image. If the TIFF file doesn't -contain an image with the specified index, the image displays as a -hollow box. -@end table - @node PostScript Images @subsection PostScript Images @cindex postscript images @@ -4653,10 +4622,7 @@ @item :index @c Doesn't work: http://debbugs.gnu.org/7978 -This has the same meaning as it does for GIF images (@pxref{GIF Images}), -i.e., it specifies which image to view inside an image bundle file format -such as DJVM@. You can use the @code{image-metadata} function to -retrieve the total number of images in an image bundle. +@xref{Multi-Frame Images}. @end table @node Other Image Types @@ -4681,13 +4647,27 @@ background color. @end table - For JPEG images, specify image type @code{jpeg}. - - For TIFF images, specify image type @code{tiff}. - - For PNG images, specify image type @code{png}. - - For SVG images, specify image type @code{svg}. +@noindent +The remaining image types that Emacs can support are: + +@table @asis +@item GIF +Image type @code{gif}. +Supports the @code{:index} property. @xref{Multi-Frame Images}. + +@item JPEG +Image type @code{jpeg}. + +@item PNG +Image type @code{png}. + +@item SVG +Image type @code{svg}. + +@item TIFF +Image type @code{tiff}. +Supports the @code{:index} property. @xref{Multi-Frame Images}. +@end table @node Defining Images @subsection Defining Images @@ -4923,20 +4903,45 @@ @var{max-image-size} is subsequently changed (@pxref{Image Cache}). @end defvar -@node Animated Images -@subsection Animated Images +@node Multi-Frame Images +@subsection Multi-Frame Images @cindex animation @cindex image animation -Some image files can contain more than one image. This can be used to -create animation. Currently, Emacs only supports animated GIF files. -The following functions related to animated images are available. - -@defun image-animated-p image -This function returns non-@code{nil} if @var{image} can be animated. -The actual return value is a cons @code{(@var{nimages} . @var{delay})}, -where @var{nimages} is the number of frames and @var{delay} is the -delay in seconds between them. +@cindex image frames +Some image files can contain more than one image. We say that there +are multiple ``frames'' in the image. At present, Emacs supports +multiple frames for GIF, TIFF, and certain ImageMagick formats such as +DJVM@. + +The frames can be used either to represent multiple ``pages'' (this is +usually the case with multi-frame TIFF files, for example), or to +create animation (usually the case with multi-frame GIF files). + +A multi-frame image has a property @code{:index}, whose value is an +integer (counting from 0) that specifies which frame is being displayed. + +@defun image-multi-frame-p image +This function returns non-@code{nil} if @var{image} contains more than +one frame. The actual return value is a cons @code{(@var{nimages} +. @var{delay})}, where @var{nimages} is the number of frames and +@var{delay} is the delay in seconds between them, if the image itself +specifies a delay. Images that are intended to be animated usually +specify a frame delay, whereas ones that are intended to be treated as +multiple pages do not. +@end defun + +@defun image-current-frame image +This function returns the index of the current frame number for +@var{image}, counting from 0. +@end defun + +@defun image-show-frame image n &optional nocheck +This function switches @var{image} to frame number @var{n}. It +replaces a frame number outside the valid range with that of the end +of the range, unless @var{nocheck} is non-@code{nil}. If @var{image} +does not contain a frame with the specified number, the image displays +as a hollow box. @end defun @defun image-animate image &optional index limit @@ -4948,7 +4953,9 @@ @end defun @noindent Animation operates by means of a timer. Note that Emacs imposes a -minimum frame delay of 0.01 seconds. +minimum frame delay of 0.01 (@code{image-minimum-frame-delay}) seconds. +If the image itself does not specify a delay, Emacs uses +@code{image-default-frame-delay}. @defun image-animate-timer image This function returns the timer responsible for animating @var{image}, === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2013-02-09 12:52:01 +0000 +++ doc/lispref/elisp.texi 2013-02-20 08:34:28 +0000 @@ -1417,15 +1417,13 @@ * Image Descriptors:: How to specify an image for use in @code{:display}. * XBM Images:: Special features for XBM format. * XPM Images:: Special features for XPM format. -* GIF Images:: Special features for GIF format. -* TIFF Images:: Special features for TIFF format. * PostScript Images:: Special features for PostScript format. * ImageMagick Images:: Special features available through ImageMagick. * Other Image Types:: Various other formats are supported. * Defining Images:: Convenient ways to define an image for later use. * Showing Images:: Convenient ways to display an image once it is defined. -* Animated Images:: Some image formats can be animated. +* Multi-Frame Images:: Some images contain more than one frame. * Image Cache:: Internal mechanisms of image display. Buttons ------------------------------------------------------------ revno: 111832 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-02-19 23:57:33 -0800 message: Rework recent image-multi-frame stuff a little * image.el (image-current-frame): Change from variable to function. (image-show-frame): Rename from image-nth-frame. Update callers. * image-mode.el (image-multi-frame): New variable. (image-mode-map, image-mode, image-goto-frame): Use image-multi-frame rather than image-current-frame. (image-mode, image-goto-frame): Use image-current-frame as function rather than as variable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-20 02:07:07 +0000 +++ lisp/ChangeLog 2013-02-20 07:57:33 +0000 @@ -1,5 +1,13 @@ 2013-02-20 Glenn Morris + * image.el (image-current-frame): Change from variable to function. + (image-show-frame): Rename from image-nth-frame. Update callers. + * image-mode.el (image-multi-frame): New variable. + (image-mode-map, image-mode, image-goto-frame): + Use image-multi-frame rather than image-current-frame. + (image-mode, image-goto-frame): Use image-current-frame as + function rather than as variable. + * emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. * emacs-lisp/cl-macs.el (cl--make-type-test) (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2013-02-17 00:50:41 +0000 +++ lisp/image-mode.el 2013-02-20 07:57:33 +0000 @@ -329,6 +329,9 @@ "The image type for the current Image mode buffer.") (make-variable-buffer-local 'image-type) +(defvar-local image-multi-frame nil + "Non-nil if image for the current Image mode buffer has multiple frames.") + (defvar image-mode-previous-major-mode nil "Internal variable to keep the previous non-image major mode.") @@ -390,7 +393,7 @@ ["Animate Image" image-toggle-animation :style toggle :selected (let ((image (image-get-display-property))) (and image (image-animate-timer image))) - :active image-current-frame + :active image-multi-frame :help "Toggle image animation"] ["Loop Animation" (lambda () (interactive) @@ -403,13 +406,13 @@ (image-toggle-animation) (image-toggle-animation))) :style toggle :selected image-animate-loop - :active image-current-frame + :active image-multi-frame :help "Animate images once, or forever?"] - ["Next Frame" image-next-frame :active image-current-frame + ["Next Frame" image-next-frame :active image-multi-frame :help "Show the next frame of this image"] - ["Previous Frame" image-previous-frame :active image-current-frame + ["Previous Frame" image-previous-frame :active image-multi-frame :help "Show the previous frame of this image"] - ["Goto Frame..." image-goto-frame :active image-current-frame + ["Goto Frame..." image-goto-frame :active image-multi-frame :help "Show a specific frame of this image"] )) map) @@ -471,12 +474,13 @@ ((null image) (message "%s" (concat msg1 "an image."))) ((setq animated (image-multi-frame-p image)) - (setq image-current-frame (or (plist-get (cdr image) :index) 0) + (setq image-multi-frame t mode-line-process - `(:eval (propertize (format " [%s/%s]" - (1+ image-current-frame) - ,(car animated)) - 'help-echo "Frame number"))) + `(:eval (propertize + (format " [%s/%s]" + (1+ (image-current-frame ',image)) + ,(car animated)) + 'help-echo "Frame number"))) (message "%s" (concat msg1 "text. This image has multiple frames."))) ;;; (substitute-command-keys @@ -694,10 +698,13 @@ (cond ((null image) (error "No image is present")) - ((null image-current-frame) + ((null image-multi-frame) (message "No image animation.")) (t - (image-nth-frame image (if relative (+ n image-current-frame) (1- n))))))) + (image-show-frame image + (if relative + (+ n (image-current-frame image)) + (1- n))))))) (defun image-next-frame (&optional n) "Switch to the next frame of a multi-frame image. === modified file 'lisp/image.el' --- lisp/image.el 2013-02-16 19:56:50 +0000 +++ lisp/image.el 2013-02-20 07:57:33 +0000 @@ -660,10 +660,11 @@ (defconst image-minimum-frame-delay 0.01 "Minimum interval in seconds between frames of an animated image.") -(defvar-local image-current-frame nil - "The frame index of the current animated image.") +(defun image-current-frame (image) + "The current frame number of IMAGE, indexed from 0." + (or (plist-get (cdr image) :index) 0)) -(defun image-nth-frame (image n &optional nocheck) +(defun image-show-frame (image n &optional nocheck) "Show frame N of IMAGE. Frames are indexed from 0. Optional argument NOCHECK non-nil means do not check N is within the range of frames present in the image." @@ -671,7 +672,6 @@ (if (< n 0) (setq n 0) (setq n (min n (1- (car (image-multi-frame-p image))))))) (plist-put (cdr image) :index n) - (setq image-current-frame n) (force-window-update)) ;; FIXME? The delay may not be the same for different sub-images, @@ -688,7 +688,7 @@ after displaying the last animation frame. Otherwise, stop after LIMIT seconds have elapsed. The minimum delay between successive frames is `image-minimum-frame-delay'." - (image-nth-frame image n t) + (image-show-frame image n t) (setq n (1+ n)) (let* ((time (float-time)) (animation (image-multi-frame-p image))