IIRC, magit-stage-item only looks at the region when the cursor is inside a diff hunk, and it assumes you're trying to stage some of the lines in the hunk without staging the whole thing.
Seeing all the files in the magit-section structure is a red herring. The sections form a tree with pointers to parents and children, so if you print one out you'll actually see every section in the buffer. On Saturday, July 2, 2011, <[email protected]> wrote: > I am seeing the same problem. I am on Windows, Emacs version 23.3.1. The problem is the same whether or not transient-mark-mode is on. > I did it is a bit of poking around to see what the problem might be. Within the body of magit-stage-item, item is correctly bound to a data structure containing all the files present in the region: > [cl-struct-magit-section [cl-struct-magit-section [cl-struct-magit-section nil status 1 3393 ([cl-struct-magit-section #2 untracked 145 1981 ... nil nil nil nil] [cl-struct-magit-section #2 stashes 1982 2143 ... nil nil nil nil] #1 [cl-struct-magit-section #2 unpushed 2487 3392 ... nil nil nil nil]) nil nil nil nil] unstaged 2144 2486 ([cl-struct-magit-section #1 "collects/drracket/private/debug.rkt" 2153 2199 nil t diff ... t] [cl-struct-magit-section #1 "collects/drracket/private/rep.rkt" 2199 2243 nil t diff ... t] [cl-struct-magit-section #1 "collects/lang/htdp-langs.rkt" 2243 2282 nil t diff ... t] [cl-struct-magit-section #1 "collects/lang/private/teach.rkt" 2282 2324 nil t diff ... t] [cl-struct-magit-section #1 "collects/scribblings/htdp-langs/beginner-abbr.scrbl" 2324 2386 nil t diff ... t] [cl-struct-magit-section #1 "collects/scribblings/htdp-langs/prim-ops.rkt" 2386 2441 nil t diff ... t] #0) nil nil nil nil] "collects/syntax/colored-errors.rkt" 2441 2486 nil t diff (modified "collects/syntax/colored-errors.rkt" nil) t] > but (magit-diff-item-file item) in magit-stage-item returns a single file. > I would be happy to help find the necessary conditions to reproduce the bug on the developer's machines. -- -PJ
