Now on revision 106700. ------------------------------------------------------------ revno: 106700 committer: Chong Yidong branch nick: trunk timestamp: Mon 2011-12-19 15:25:46 +0800 message: More updates for VC documentation. * doc/emacs/maintaining.texi (VCS Merging, VCS Changesets): Index entries. (VC Mode Line): Add index entry for "version control status". (VC Undo): Use vc-revert instead of its vc-revert-buffer alias. Document vc-revert-show-diff. De-document vc-rollback. (VC Directory Mode): Rewrite introduction. Move prefix arg documentation here from VC Directory Buffer node. (VC Directory Buffer): Use a decentralized VCS example. (VC Directory Commands): Use a table. Remove material duplicated in previous nodes on multi-file VC filsets. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2011-11-28 11:12:00 +0000 +++ admin/FOR-RELEASE 2011-12-19 07:25:46 +0000 @@ -61,13 +61,6 @@ * BUGS -** Does deleting frames run Lisp code? If so, can we get rid of that? -It is a dangerous design. -http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01330.html - -** Why were the calls to x_fully_uncatch_errors commented out in eval.c? -http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01987.html - ** rms: gnus-dired.el is a mistake. Those features should not be part of Gnus. They should be moved to some other part of Emacs. rsteib: Gnus dependencies in `gnus-dired.el' (and `mailcap.el') have been @@ -90,25 +83,8 @@ `log-edit-comment-search-forward'. Perhaps search commands on the global key binding `M-s' are useless in these modes. -** sdl.web@gmail.com, 30 Oct: ps-lpr-switches has no effect -http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg02091.html - -Fixed by this change? - -2007-11-09 Vinicius Jose Latorre - - * ps-print.el: [...] - (ps-do-despool): If ps-lpr-switches is not a list, force it to be one. - -** In C, use EMACS_INT for variables and structure members -for buffer/string positions. E.g. struct it, struct text_pos. - * DOCUMENTATION -** Clean up Emacs.app references in code and documentation. - -** Document new font backend - ** Document XEmbed support ** Check the Emacs Tutorial. @@ -154,7 +130,7 @@ arevert-xtra.texi cyd basic.texi cyd buffers.texi cyd -building.texi +building.texi cyd calendar.texi cal-xtra.texi cmdargs.texi @@ -188,13 +164,13 @@ mule.texi m-x.texi cyd picture-xtra.texi -programs.texi +programs.texi cyd regs.texi cyd rmail.texi screen.texi cyd search.texi cyd sending.texi -text.texi +text.texi cyd trouble.texi vc-xtra.texi vc1-xtra.texi === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-12-17 07:50:08 +0000 +++ doc/emacs/ChangeLog 2011-12-19 07:25:46 +0000 @@ -1,3 +1,15 @@ +2011-12-19 Chong Yidong + + * maintaining.texi (VCS Merging, VCS Changesets): Index entries. + (VC Mode Line): Add index entry for "version control status". + (VC Undo): Use vc-revert instead of its vc-revert-buffer alias. + Document vc-revert-show-diff. De-document vc-rollback. + (VC Directory Mode): Rewrite introduction. Move prefix arg + documentation here from VC Directory Buffer node. + (VC Directory Buffer): Use a decentralized VCS example. + (VC Directory Commands): Use a table. Remove material duplicated + in previous nodes on multi-file VC filsets. + 2011-12-17 Chong Yidong * maintaining.texi (VCS Concepts): Make "revision" terminology === modified file 'doc/emacs/maintaining.texi' --- doc/emacs/maintaining.texi 2011-12-17 07:50:08 +0000 +++ doc/emacs/maintaining.texi 2011-12-19 07:25:46 +0000 @@ -227,17 +227,18 @@ @node VCS Merging @subsubsection Merge-based vs lock-based Version Control -@cindex locking versus merging A version control system typically has some mechanism to coordinate between users who want to change the same file. There are two ways to do this: merging and locking. +@cindex merging-based version In a version control system that uses merging, each user may modify a work file at any time. The system lets you @dfn{merge} your work file, which may contain changes that have not been committed, with the latest changes that others have committed. +@cindex locking-based version Older version control systems use a @dfn{locking} scheme instead. Here, work files are normally read-only. To edit a file, you ask the version control system to make it writable for you by @dfn{locking} @@ -274,7 +275,7 @@ @node VCS Changesets @subsubsection Changeset-based vs File-based Version Control -@cindex changesets +@cindex file-based version control On SCCS, RCS, CVS, and other early version control systems, version control operations are @dfn{file-based}: each file has its own comment and revision history separate from that of all other files. Newer @@ -283,6 +284,7 @@ changes is handled as a unit. Any comment associated with the change does not belong to a single file, but to the changeset itself. +@cindex changeset-based version control Changeset-based version control is more flexible and powerful than file-based version control; usually, when a change to multiple files has to be reversed, it's good to be able to easily identify and remove @@ -356,20 +358,22 @@ @node VC Mode Line @subsection Version Control and the Mode Line -@cindex VC, mode line indicator +@cindex VC mode line indicator When you visit a file that is under version control, Emacs indicates this on the mode line. For example, @samp{Bzr-1223} says that Bazaar is used for that file, and the current revision ID is 1223. +@cindex version control status The character between the back-end name and the revision ID -indicates the status of the work file. In a merge-based version -control system, a @samp{-} character indicates that the work file is -unmodified, and @samp{:} indicates that it has been modified. -@samp{!} indicates that the file contains conflicts as result of a -recent merge operation (@pxref{Merging}), or that the file was removed -from the version control. Finally, @samp{?} means that the file is -under version control, but is missing from the working tree. +indicates the @dfn{version control status} of the work file. In a +merge-based version control system, a @samp{-} character indicates +that the work file is unmodified, and @samp{:} indicates that it has +been modified. @samp{!} indicates that the file contains conflicts as +result of a recent merge operation (@pxref{Merging}), or that the file +was removed from the version control. Finally, @samp{?} means that +the file is under version control, but is missing from the working +tree. In a lock-based system, @samp{-} indicates an unlocked file, and @samp{:} a locked file; if the file is locked by another user (for @@ -399,6 +403,7 @@ @subsection Basic Editing under Version Control @cindex filesets, VC +@cindex VC filesets Most VC commands operate on @dfn{VC filesets}. A VC fileset is a collection of one or more files that a VC operation acts on. When you type VC commands in a buffer visiting a version-controlled file, the @@ -451,9 +456,9 @@ @itemize @bullet @item If there is more than one file in the VC fileset and the files have -inconsistent version control states, signal an error. (Note, however, -that a fileset is allowed to include both ``newly-added'' files and -``modified'' files; @pxref{Registering}.) +inconsistent version control statuses, signal an error. (Note, +however, that a fileset is allowed to include both ``newly-added'' +files and ``modified'' files; @pxref{Registering}.) @item If none of the files in the VC fileset are registered with a version @@ -504,7 +509,7 @@ @itemize @bullet @item If there is more than one file in the VC fileset and the files have -inconsistent version control states, signal an error. +inconsistent version control statuses, signal an error. @item If each file in the VC fileset is not registered with a version @@ -887,7 +892,7 @@ @table @kbd @item C-x v l -Display revision control state and change history +Display the change history for the current fileset (@code{vc-print-log}). @item C-x v L @@ -927,8 +932,8 @@ maximum number of revisions to display. The @kbd{C-x v L} history is shown in a compact form, usually -omitting all but the first line of each log entry. However, you can -type @key{RET} (@code{log-view-toggle-entry-display}) in the +showing only the first line of each log entry. However, you can type +@key{RET} (@code{log-view-toggle-entry-display}) in the @samp{*vc-change-log*} buffer to reveal the entire log entry for the revision at point. A second @key{RET} hides it again. @@ -1008,58 +1013,67 @@ @table @kbd @item C-x v u -Revert the buffer and the file to the working revision from which you started -editing the file. - -@item C-x v c -Remove the last-entered change from the master for the visited file. -This undoes your last commit. +Revert the work file(s) in the current VC fileset to the last revision +(@code{vc-revert}). @end table +@c `C-x v c' (vc-rollback) was removed, since it's RCS/SCCS specific. + @kindex C-x v u -@findex vc-revert-buffer - If you want to discard your current set of changes and revert to the -working revision from which you started editing the file, use @kbd{C-x -v u} (@code{vc-revert-buffer}). If the version control system is -locking-based, this leaves the file unlocked, and you must lock it -again before making new changes. @kbd{C-x v u} requires confirmation, -unless it sees that you haven't made any changes with respect to the -master copy of the working revision. - - @kbd{C-x v u} is also the command to unlock a file if you lock it and -then decide not to change it. - -@kindex C-x v c -@findex vc-rollback - To cancel a change that you already committed, use @kbd{C-x v c} -(@code{vc-rollback}). This command discards all record of the most -recent checked-in revision, but only if your work file corresponds to -that revision---you cannot use @kbd{C-x v c} to cancel a revision that -is not the latest on its branch. Note that many version control -systems do not support rollback at all; this command is something of a -historical relic. +@findex vc-revert +@vindex vc-revert-show-diff + If you want to discard all the changes you have made to the current +VC fileset, type @kbd{C-x v u} (@code{vc-revert-buffer}). This shows +you a diff between the work file(s) and the revision from which you +started editing, and asks for confirmation for discarding the changes. +If you agree, the fileset is reverted. If you don't want @kbd{C-x v +u} to show a diff, set the variable @code{vc-revert-show-diff} to +@code{nil} (you can still view the diff directly with @kbd{C-x v =}; +@pxref{Old Revisions}). Note that @kbd{C-x v u} cannot be reversed +with the usual undo commands (@pxref{Undo}), so use it with care. + + On locking-based version control systems, @kbd{C-x v u} leaves files +unlocked; you must lock again to resume editing. You can also use +@kbd{C-x v u} to unlock a file if you lock it and then decide not to +change it. @node VC Directory Mode @subsection VC Directory Mode +@cindex VC Directory buffer + The @dfn{VC Directory buffer} is a specialized buffer for viewing +the version control statuses of the files in a directory tree, and +performing version control operations on those files. In particular, +it is used to specify multi-file VC filesets for commands like +@w{@kbd{C-x v v}} to act on (@pxref{VC Directory Commands}). + @kindex C-x v d @findex vc-dir - When you are working on a large program, it is often useful to find -out which files have changed within an entire directory tree, or to -view the status of all files under version control at once, and to -perform version control operations on collections of files. You can -use the command @kbd{C-x v d} (@code{vc-dir}) to make a directory -listing that includes only files relevant for version control. This -creates a @dfn{VC Directory buffer} and displays it in a separate -window. - + To use the VC Directory buffer, type @kbd{C-x v d} (@code{vc-dir}). +This reads a directory name using the minibuffer, and switches to a VC +Directory buffer for that directory. By default, the buffer is named +@samp{*vc-dir*}. Its contents are described +@iftex +below. +@end iftex +@ifnottex +in @ref{VC Directory Buffer}. +@end ifnottex + + The @code{vc-dir} command automatically detects the version control +system to be used in the specified directory. In the event that more +than one system is being used in the directory, you should invoke the +command with a prefix argument, @kbd{C-u C-x v d}; this prompts for +the version control system which the VC Directory buffer should use. + +@ifnottex @cindex PCL-CVS @pindex cvs @cindex CVS directory mode - The VC Directory buffer works with all the version control systems -that VC supports. For CVS, Emacs also offers a more powerful facility -called PCL-CVS. @xref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The -Emacs Front-End to CVS}. + In addition to the VC Directory buffer, Emacs has a similar facility +called PCL-CVS which is specialized for CVS. @xref{Top, , About +PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}. +@end ifnottex @menu * Buffer: VC Directory Buffer. What the buffer looks like and means. @@ -1070,152 +1084,188 @@ @subsubsection The VC Directory Buffer The VC Directory buffer contains a list of version-controlled files -in the current directory and its subdirectories. Files which are -up-to-date (have no local differences from the repository copy) are -usually hidden; if all files in a subdirectory are up-to-date, the -subdirectory is hidden as well. There is an exception to this rule: -if VC mode detects that a file has changed to an up-to-date state -since you last looked at it, that file and its state are shown. - - If a directory uses more that one version control system, you can -select which system to use for the @code{vc-dir} command by invoking -@code{vc-dir} with a prefix argument: @kbd{C-u C-x v d}. - - The line for an individual file shows the version control state of -the file. Under RCS and SCCS, the name of the user locking the file -is shown; under CVS, an abbreviated version of the @samp{cvs status} -output is used. Here is an example using CVS: +and their version control statuses. It lists files in the current +directory (the one specified when you called @kbd{C-x v d}) and its +subdirectories, but only those with a ``noteworthy'' status. Files +that are up-to-date (i.e.@: the same as in the repository) are +omitted. If all the files in a subdirectory are up-to-date, the +subdirectory is not listed either. As an exception, if a file has +become up-to-date as a direct result of a VC command, it is listed. + + Here is an example of a VC Directory buffer listing: @smallexample @group - ./ - modified file1.c - needs-update file2.c - needs-merge file3.c + ./ + edited configure.ac +* added README + unregistered temp.txt + src/ +* edited src/main.c @end group @end smallexample @noindent -In this example, @samp{file1.c} is modified with respect to the -repository, and @samp{file2.c} is not. @samp{file3.c} is modified, -but other changes have also been committed---you need to merge them -with the work file before you can check it in. - +Two work files have been modified but not committed: +@file{configure.ac} in the current directory, and @file{foo.c} in the +@file{src/} subdirectory. The file named @file{README} has been added +but is not yet committed, while @file{temp.txt} is not under version +control (@pxref{Registering}). + +The @samp{*} characters next to the entries for @file{README} and +@file{src/main.c} indicate that the user has marked out these files as +the current VC fileset +@iftex +(see below). +@end iftex +@ifnottex +(@pxref{VC Directory Commands}). +@end ifnottex + + The above example is typical for a decentralized version control +system like Bazaar, Git, or Mercurial. Other systems can show other +statuses. For instance, CVS shows the @samp{needs-update} status if +the repository has changes that have not been applied to the work +file. RCS and SCCS show the name of the user locking a file as its +status. + +@ifnottex @vindex vc-stay-local @vindex vc-cvs-stay-local - In the above, if the repository were on a remote machine, VC only -contacts it when the variable @code{vc-stay-local} (or -@code{vc-cvs-stay-local}) is @code{nil} -@iftex -(@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}). -@end iftex -@ifnottex -(@pxref{CVS Options}). + On CVS and Subversion, the @code{vc-dir} command normally contacts +the repository, which may be on a remote machine, to check for +updates. If you change the variable @code{vc-stay-local} or +@code{vc-cvs-stay-local} (for CVS) to @code{nil} (@pxref{CVS +Options}), then Emacs avoids contacting a remote repository when +generating the VC Directory buffer (it will still contact it when +necessary, e.g.@: when doing a commit). This may be desirable if you +are working offline or the network is slow. @end ifnottex -This is because access to the repository may be slow, or you may be -working offline and not have access to the repository at all. As a -consequence, VC would not be able to tell you that @samp{file3.c} is -in the ``merge'' state; you would learn that only when you try to -commit your modified copy of the file, or use a command such as -@kbd{C-x v m}. - - In practice, this is not a problem because CVS handles this case -consistently whenever it arises. In VC, you'll simply get prompted to -merge the remote changes into your work file first. The benefits of -less network communication usually outweigh the disadvantage of not -seeing remote changes immediately. @vindex vc-directory-exclusion-list - When a VC directory displays subdirectories it omits some that -should never contain any files under version control. By default, -this includes Version Control subdirectories such as @samp{RCS} and -@samp{CVS}; you can customize this by setting the variable -@code{vc-directory-exclusion-list}. + The VC Directory buffer omits subdirectories listed in the variable +@code{vc-directory-exclusion-list}. The default value of this +variable contains directories that are used internally by version +control systems. @node VC Directory Commands @subsubsection VC Directory Commands - VC Directory mode has a full set of navigation and marking commands -for picking out filesets. Some of these are also available in a -context menu invoked by @kbd{mouse-2}. - - Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also -move vertically as in other list-browsing modes. @key{SPC} and -@key{TAB} behave like down-arrow, and @key{BackTab} behaves like -up-arrow. - - Both @kbd{C-m} and @kbd{f} visit the file on the current -line. @kbd{o} visits that file in another window. @kbd{q} dismisses -the directory buffer. - - @kbd{x} hides up-to-date files. - - @kbd{m} marks the file or directory on the current line. If the -region is active, @kbd{m} marks all the files in the region. There -are some restrictions when marking: a file cannot be marked if any of -its parent directories are marked, and a directory cannot be marked if -any files in it or in its child directories are marked. - - @kbd{M} marks all the files with the same VC state as the current -file if the cursor is on a file. If the cursor is on a directory, it -marks all child files. With a prefix argument: marks all files and -directories. - - @kbd{u} unmarks the file or directory on the current line. If the -region is active, it unmarks all the files in the region. - - @kbd{U} marks all the files with the same VC state as the current file -if the cursor is on a file. If the cursor is on a directory, it -unmarks all child files. With a prefix argument: unmarks all marked + Emacs provides several commands for navigating the VC Directory +buffer, and for ``marking'' files as belonging to the current VC +fileset. + +@table @kbd +@item n +@itemx @key{SPC} +Move point to the next entry (@code{vc-dir-next-line}). + +@item p +Move point to the previous entry (@code{vc-dir-previous-line}). + +@item @key{TAB} +Move to the next directory entry (@code{vc-dir-next-directory}). + +@item S-@key{TAB} +Move to the previous directory entry +(@code{vc-dir-previous-directory}). + +@item @key{RET} +@itemx f +Visit the file or directory listed on the current line +(@code{vc-dir-find-file}). + +@item o +Visit the file or directory on the current line, in a separate window +(@code{vc-dir-find-file-other-window}). + +@item m +Mark the file or directory on the current line (@code{vc-dir-mark}), +putting it in the current VC fileset. If the region is active, mark +all files in the region. + +A file cannot be marked with this command if it is already in a marked +directory, or one of its subdirectories. Similarly, a directory +cannot be marked with this command if any file in its tree is marked. + +@item M +If point is on a file entry, mark all files with the same status; if +point is on a directory entry, mark all files in that directory tree +(@code{vc-dir-mark-all-files}). With a prefix argument, mark all +listed files and directories. + +@item u +Unmark the file or directory on the current line. If the region is +active, unmark all the files in the region (@code{vc-dir-unmark}). + +@item U +If point is on a file entry, umark all files with the same status; if +point is on a directory entry, unmark all files in that directory tree +(@code{vc-dir-unmark-all-files}). With a prefix argument, unmark all files and directories. - It is possible to do search, search and replace, incremental search, -and incremental regexp search on multiple files. These commands will -work on all the marked files or the current file if nothing is marked. -If a directory is marked, the files in that directory shown in the VC -directory buffer will be used. - - @kbd{S} searches the marked files. - - @kbd{Q} does a query replace on the marked files. - - @kbd{M-s a C-s} does an incremental search on the marked files. - - @kbd{M-s a C-M-s} does an incremental regular expression search -on the marked files. +@item x +Hide files with @samp{up-to-date} status +(@code{vc-dir-hide-up-to-date}). + +@item q +Quit the VC Directory buffer, and bury it (@code{quit-window}). +@end table + +@findex vc-dir-mark +@findex vc-dir-mark-all-files + While in the VC Directory buffer, all the files that you mark with +@kbd{m} (@code{vc-dir-mark}) or @kbd{M} (@code{vc-dir-mark}) are in +the current VC fileset. If you mark a directory entry with @kbd{m}, +all the listed files in that directory tree are in the current VC +fileset. The files and directories that belong to the current VC +fileset are indicated with a @samp{*} character in the VC Directory +buffer, next to their VC status. In this way, you can set up a +multi-file VC fileset to be acted on by VC commands like @w{@kbd{C-x v +v}} (@pxref{Basic VC Editing}), @w{@kbd{C-x v =}} (@pxref{Old +Revisions}), and @w{@kbd{C-x v u}} (@pxref{VC Undo}). + + The VC Directory buffer also defines some single-key shortcuts for +VC commands with the @kbd{C-x v} prefix: @kbd{=}, @kbd{+}, @kbd{l}, +@kbd{i}, and @kbd{v}. + + For example, you can commit a set of edited files by opening a VC +Directory buffer, where the files are listed with the @samp{edited} +status; marking the files; and typing @kbd{v} or @kbd{C-x v v} +(@code{vc-next-action}). If the version control system is +changeset-based, Emacs will commit the files in a single revision. + + While in the VC Directory buffer, you can also perform search and +replace on the current VC fileset, with the following commands: + +@table @kbd +@item S +Search the fileset (@code{vc-dir-search}). + +@item Q +Do a regular expression query replace on the fileset +(@code{vc-dir-query-replace-regexp}). + +@item M-s a C-s +Do an incremental search on the fileset (@code{vc-dir-isearch}). + +@item M-s a C-M-s +Do an incremental regular expression search on the fileset +(@code{vc-dir-isearch-regexp}). +@end table + +@noindent +Apart from acting on multiple files, these commands behave much like +their single-buffer counterparts (@pxref{Search}). @cindex stashes in version control @cindex shelves in version control - Commands are also accessible from the VC-dir menu. Note that some -VC backends use the VC-dir menu to make available extra, -backend-specific, commands. For example, Git and Bazaar allow you to -manipulate @dfn{stashes} and @dfn{shelves}. (These provide a -mechanism to temporarily store uncommitted changes somewhere out of -the way, and bring them back at a later time.) - - Normal VC commands with the @kbd{C-x v} prefix work in VC directory -buffers. Some single-key shortcuts are available as well; @kbd{=}, -@kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with -@kbd{C-x v}. - - The command @kbd{C-x v v} (@code{vc-next-action}) operates on all -the marked files, so that you can commit several files at once. If -the underlying VC supports atomic commits of multiple-file changesets, -@kbd{C-x v v} with a selected set of modified but not committed files -will commit all of them at once as a single changeset. - - When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple -files, all of those files must be either in the same state or in -compatible states (added, modified and removed states are considered -compatible). Otherwise it signals an error. This differs from the -behavior of older versions of VC, which did not have fileset -operations and simply did @code{vc-next-action} on each file -individually. - - If any files are in a state that calls for commit, @kbd{C-x v v} reads a -single log entry and uses it for the changeset as a whole. If the -underling VCS is file- rather than changeset-oriented, the log entry -will be replicated into the history of each file. + The above commands are also available via the menu bar, and via a +context menu invoked by @kbd{Mouse-2}. Furthermore, some VC backends +use the menu to provide extra backend-specific commands. For example, +Git and Bazaar allow you to manipulate @dfn{stashes} and @dfn{shelves} +(where are a way to temporarily put aside uncommitted changes, and +bring them back at a later time). @node Branches @subsection Multiple Branches of a File === modified file 'etc/NEWS' --- etc/NEWS 2011-12-17 07:50:08 +0000 +++ etc/NEWS 2011-12-19 07:25:46 +0000 @@ -849,6 +849,7 @@ **** Currently supported for Bzr, Git, and Mercurial. ++++ *** New option `vc-revert-show-diff' controls whether `vc-revert' shows a diff while querying the user. It defaults to t. ------------------------------------------------------------ revno: 106699 committer: Chong Yidong branch nick: trunk timestamp: Mon 2011-12-19 15:00:16 +0800 message: Fix bugs in vc-dir-mark-unmark and vc-dir-mark-all-files. * lisp/vc/vc-dir.el (vc-dir-parent-marked-p, vc-dir-children-marked-p): Don't signal an error in a predicate function; return non-nil. (vc-dir-mark-file): Move the error here. (vc-dir-mark-unmark): If acting on the region, keep going if one of the entries cannot be marked/unmarked. (vc-dir-mark-all-files): If current entry is a directory, mark only child files, as documented. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-19 06:30:36 +0000 +++ lisp/ChangeLog 2011-12-19 07:00:16 +0000 @@ -1,3 +1,13 @@ +2011-12-19 Chong Yidong + + * vc/vc-dir.el (vc-dir-parent-marked-p, vc-dir-children-marked-p): + Don't signal an error in a predicate function; return non-nil. + (vc-dir-mark-file): Move the error here. + (vc-dir-mark-unmark): If acting on the region, keep going if one + of the entries cannot be marked/unmarked. + (vc-dir-mark-all-files): If current entry is a directory, mark + only child files, as documented. + 2011-12-19 Vincent Belaïche * ses.el: Ooops... undo changes of revision 106664, as trunk === modified file 'lisp/vc/vc-dir.el' --- lisp/vc/vc-dir.el 2011-11-20 02:29:42 +0000 +++ lisp/vc/vc-dir.el 2011-12-19 07:00:16 +0000 @@ -534,57 +534,71 @@ (save-excursion (goto-char (region-beginning)) (while (<= (line-number-at-pos) lastl) - (funcall mark-unmark-function)))) + (condition-case nil + (funcall mark-unmark-function) + ;; `vc-dir-mark-file' signals an error if we try marking + ;; a directory containing marked files in its tree, or a + ;; file in a marked directory tree. Just continue. + (error (vc-dir-next-line 1)))))) (funcall mark-unmark-function))) (defun vc-dir-parent-marked-p (arg) - ;; Return nil if none of the parent directories of arg is marked. + ;; Non-nil iff a parent directory of arg is marked. + ;; Return value, if non-nil is the `ewoc-data' for the marked parent. (let* ((argdir (vc-dir-node-directory arg)) (arglen (length argdir)) (crt arg) - data dir) + (found nil)) ;; Go through the predecessors, checking if any directory that is ;; a parent is marked. - (while (setq crt (ewoc-prev vc-ewoc crt)) - (setq data (ewoc-data crt)) - (setq dir (vc-dir-node-directory crt)) - (when (and (vc-dir-fileinfo->directory data) - (vc-string-prefix-p dir argdir)) - (when (vc-dir-fileinfo->marked data) - (error "Cannot mark `%s', parent directory `%s' marked" - (vc-dir-fileinfo->name (ewoc-data arg)) - (vc-dir-fileinfo->name data))))) - nil)) + (while (and (null found) + (setq crt (ewoc-prev vc-ewoc crt))) + (let ((data (ewoc-data crt)) + (dir (vc-dir-node-directory crt))) + (and (vc-dir-fileinfo->directory data) + (vc-string-prefix-p dir argdir) + (vc-dir-fileinfo->marked data) + (setq found data)))) + found)) (defun vc-dir-children-marked-p (arg) - ;; Return nil if none of the children of arg is marked. + ;; Non-nil iff a child of ARG is marked. + ;; Return value, if non-nil, is the `ewoc-data' for the marked child. (let* ((argdir-re (concat "\\`" (regexp-quote (vc-dir-node-directory arg)))) (is-child t) (crt arg) - data dir) - (while (and is-child (setq crt (ewoc-next vc-ewoc crt))) - (setq data (ewoc-data crt)) - (setq dir (vc-dir-node-directory crt)) - (if (string-match argdir-re dir) - (when (vc-dir-fileinfo->marked data) - (error "Cannot mark `%s', child `%s' marked" - (vc-dir-fileinfo->name (ewoc-data arg)) - (vc-dir-fileinfo->name data))) - ;; We are done, we got to an entry that is not a child of `arg'. - (setq is-child nil))) - nil)) + (found nil)) + (while (and is-child + (null found) + (setq crt (ewoc-next vc-ewoc crt))) + (let ((data (ewoc-data crt)) + (dir (vc-dir-node-directory crt))) + (if (string-match argdir-re dir) + (if (vc-dir-fileinfo->marked data) + (setq found data)) + ;; We are done, we got to an entry that is not a child of `arg'. + (setq is-child nil)))) + found)) (defun vc-dir-mark-file (&optional arg) ;; Mark ARG or the current file and move to the next line. (let* ((crt (or arg (ewoc-locate vc-ewoc))) (file (ewoc-data crt)) - (isdir (vc-dir-fileinfo->directory file))) - (when (or (and isdir (not (vc-dir-children-marked-p crt))) - (and (not isdir) (not (vc-dir-parent-marked-p crt)))) - (setf (vc-dir-fileinfo->marked file) t) - (ewoc-invalidate vc-ewoc crt) - (unless (or arg (mouse-event-p last-command-event)) - (vc-dir-next-line 1))))) + (isdir (vc-dir-fileinfo->directory file)) + ;; Forbid marking a directory containing marked files in its + ;; tree, or a file in a marked directory tree. + (conflict (if isdir + (vc-dir-children-marked-p crt) + (vc-dir-parent-marked-p crt)))) + (when conflict + (error (if isdir + "File `%s' in this directory is already marked" + "Parent directory `%s' is already marked") + (vc-dir-fileinfo->name conflict))) + (setf (vc-dir-fileinfo->marked file) t) + (ewoc-invalidate vc-ewoc crt) + (unless (or arg (mouse-event-p last-command-event)) + (vc-dir-next-line 1)))) (defun vc-dir-mark () "Mark the current file or all files in the region. @@ -621,19 +635,19 @@ (setf (vc-dir-fileinfo->marked filearg) t) t)) vc-ewoc)) - (let ((data (ewoc-data (ewoc-locate vc-ewoc)))) + (let* ((crt (ewoc-locate vc-ewoc)) + (data (ewoc-data crt))) (if (vc-dir-fileinfo->directory data) ;; It's a directory, mark child files. - (let ((crt (ewoc-locate vc-ewoc))) - (unless (vc-dir-children-marked-p crt) - (while (setq crt (ewoc-next vc-ewoc crt)) - (let ((crt-data (ewoc-data crt))) - (unless (vc-dir-fileinfo->directory crt-data) - (setf (vc-dir-fileinfo->marked crt-data) t) - (ewoc-invalidate vc-ewoc crt)))))) + (let (crt-data) + (while (and (setq crt (ewoc-next vc-ewoc crt)) + (setq crt-data (ewoc-data crt)) + (not (vc-dir-fileinfo->directory crt-data))) + (setf (vc-dir-fileinfo->marked crt-data) t) + (ewoc-invalidate vc-ewoc crt))) ;; It's a file - (let ((state (vc-dir-fileinfo->state data)) - (crt (ewoc-nth vc-ewoc 0))) + (let ((state (vc-dir-fileinfo->state data))) + (setq crt (ewoc-nth vc-ewoc 0)) (while crt (let ((crt-data (ewoc-data crt))) (when (and (not (vc-dir-fileinfo->marked crt-data)) ------------------------------------------------------------ revno: 106698 committer: Vincent Belaïche branch nick: trunk timestamp: Mon 2011-12-19 07:30:36 +0100 message: Ooops... undo changes of revision 106664, as trunk branch is feature frozen, and revision 106664 was a feature addition. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-18 13:49:38 +0000 +++ lisp/ChangeLog 2011-12-19 06:30:36 +0000 @@ -1,3 +1,9 @@ +2011-12-19 Vincent Belaïche + + * ses.el: Ooops... undo changes of revision 106664, as trunk + branch is feature frozen, and revision 106664 was a feature + addition. + 2011-12-18 Jan Djärv * term/ns-win.el (ns-get-selection-internal) === modified file 'lisp/ses.el' --- lisp/ses.el 2011-12-11 17:08:11 +0000 +++ lisp/ses.el 2011-12-19 06:30:36 +0000 @@ -674,13 +674,6 @@ (put sym 'ses-cell (cons xrow xcol)) (make-local-variable sym))))) -(defun ses-create-cell-variable (sym row col) - "Create a buffer-local variable for cell with symbol -SYM at position ROW COL. Return nil in case of failure." - (unless (local-variable-p sym) - (make-local-variable sym) - (put sym 'ses-cell (cons row col)))) - ;; We do not delete the ses-cell properties for the cell-variables, in ;; case a formula that refers to this cell is in the kill-ring and is ;; later pasted back in. @@ -1406,8 +1399,7 @@ Sets `ses-relocate-return' to 'delete if cell-references were removed." (let (rowcol result) (if (or (atom formula) (eq (car formula) 'quote)) - (if (and (setq rowcol (ses-sym-rowcol formula)) - (string-match "\\`[A-Z]+[0-9]+\\'" (symbol-name formula))) + (if (setq rowcol (ses-sym-rowcol formula)) (ses-relocate-symbol formula rowcol startrow startcol rowincr colincr) formula) ; Pass through as-is. @@ -1515,15 +1507,14 @@ the rectangle (MINROW,MINCOL)..(NUMROWS,NUMCOLS) by adding ROWINCR and COLINCR to each symbol." (let (reform) - (let (mycell newval xrow) + (let (mycell newval) (dotimes-with-progress-reporter (row ses--numrows) "Relocating formulas..." (dotimes (col ses--numcols) (setq ses-relocate-return nil mycell (ses-get-cell row col) newval (ses-relocate-formula (ses-cell-formula mycell) - minrow mincol rowincr colincr) - xrow (- row rowincr)) + minrow mincol rowincr colincr)) (ses-set-cell row col 'formula newval) (if (eq ses-relocate-return 'range) ;; This cell contains a (ses-range X Y) where a cell has been @@ -1539,22 +1530,8 @@ minrow mincol rowincr colincr)) (ses-set-cell row col 'references newval) (and (>= row minrow) (>= col mincol) - (let ((sym (ses-cell-symbol row col)) - (xcol (- col colincr))) - (if (and - sym - (>= xrow 0) - (>= xcol 0) - (null (eq sym - (ses-create-cell-symbol xrow xcol)))) - ;; This is a renamed cell, do not update the cell - ;; name, but just update the coordinate property. - (put sym 'ses-cell (cons row col)) - (ses-set-cell row col 'symbol - (setq sym (ses-create-cell-symbol row col))) - (unless (and (boundp sym) (local-variable-p sym)) - (set (make-local-variable sym) nil) - (put sym 'ses-cell (cons row col)))))) ))) + (ses-set-cell row col 'symbol + (ses-create-cell-symbol row col)))))) ;; Relocate the cell values. (let (oldval myrow mycol xrow xcol) (cond @@ -1567,17 +1544,11 @@ (setq mycol (+ col mincol) xrow (- myrow rowincr) xcol (- mycol colincr)) - (let ((sym (ses-cell-symbol myrow mycol)) - (xsym (ses-create-cell-symbol xrow xcol))) - ;; Make the value relocation only when if the cell is not - ;; a renamed cell. Otherwise this is not needed. - (and (eq sym xsym) - (ses-set-cell myrow mycol 'value - (if (and (< xrow ses--numrows) (< xcol ses--numcols)) - (ses-cell-value xrow xcol) - ;;Cell is off the end of the array - (symbol-value xsym)))))))) - + (if (and (< xrow ses--numrows) (< xcol ses--numcols)) + (setq oldval (ses-cell-value xrow xcol)) + ;; Cell is off the end of the array. + (setq oldval (symbol-value (ses-create-cell-symbol xrow xcol)))) + (ses-set-cell myrow mycol 'value oldval)))) ((and (wholenump rowincr) (wholenump colincr)) ;; Insertion of rows and/or columns. Run the loop backwards. (let ((disty (1- ses--numrows)) @@ -1687,6 +1658,7 @@ (message "Upgrading from SES-1 file format"))) (or (= ses--file-format 2) (error "This file needs a newer version of the SES library code")) + (ses-create-cell-variable-range 0 (1- ses--numrows) 0 (1- ses--numcols)) ;; Initialize cell array. (setq ses--cells (make-vector ses--numrows nil)) (dotimes (row ses--numrows) @@ -1706,10 +1678,11 @@ (dotimes (row ses--numrows) (dotimes (col ses--numcols) (let* ((x (read (current-buffer))) - (sym (car-safe (cdr-safe x)))) + (rowcol (ses-sym-rowcol (car-safe (cdr-safe x))))) (or (and (looking-at "\n") (eq (car-safe x) 'ses-cell) - (ses-create-cell-variable sym row col)) + (eq row (car rowcol)) + (eq col (cdr rowcol))) (error "Cell-def error")) (eval x))) (or (looking-at "\n\n") @@ -3166,60 +3139,6 @@ (mouse-set-point event) (ses-insert-ses-range)) -(defun ses-replace-name-in-formula (formula old-name new-name) - (let ((new-formula formula)) - (unless (and (consp formula) - (eq (car-safe formula) 'quote)) - (while formula - (let ((elt (car-safe formula))) - (cond - ((consp elt) - (setcar formula (ses-replace-name-in-formula elt old-name new-name))) - ((and (symbolp elt) - (eq (car-safe formula) old-name)) - (setcar formula new-name)))) - (setq formula (cdr formula)))) - new-formula)) - -(defun ses-rename-cell (new-name) - "Rename current cell." - (interactive "*SEnter new name: ") - (ses-check-curcell) - (or - (and (local-variable-p new-name) - (ses-sym-rowcol new-name) - (error "Already a cell name")) - (and (boundp new-name) - (null (yes-or-no-p (format "`%S' is already bound outside this buffer, continue? " - new-name))) - (error "Already a bound cell name"))) - (let* ((rowcol (ses-sym-rowcol ses--curcell)) - (cell (ses-get-cell (car rowcol) (cdr rowcol)))) - (dolist (reference (ses-cell-references (car rowcol) (cdr rowcol))) - (let* ((rowcol (ses-sym-rowcol reference)) - (cell (ses-get-cell (car rowcol) (cdr rowcol)))) - (ses-cell-set-formula (car rowcol) - (cdr rowcol) - (ses-replace-name-in-formula - (ses-cell-formula cell) - ses--curcell - new-name)))) - (put new-name 'ses-cell rowcol) - (set new-name (symbol-value ses--curcell)) - (aset cell 0 new-name) - (put ses--curcell 'ses-cell nil) - (makunbound ses--curcell) - (setq ses--curcell new-name) - (let* ((pos (point)) - (inhibit-read-only t) - (col (current-column)) - (end (save-excursion - (move-to-column (1+ col)) - (if (eolp) - (+ pos (ses-col-width col) 1) - (point))))) - (put-text-property pos end 'intangible new-name))) ) - ;;---------------------------------------------------------------------------- ;; Checking formulas for safety ------------------------------------------------------------ revno: 106697 committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-12-18 22:21:24 -0800 message: Spelling fixes. diff: === modified file 'admin/grammars/bovine-grammar.el' --- admin/grammars/bovine-grammar.el 2011-11-26 09:10:36 +0000 +++ admin/grammars/bovine-grammar.el 2011-12-19 06:21:24 +0000 @@ -298,7 +298,7 @@ example, a SYMBOL might need to match \"foo\". Some TYPES will not have matching criteria. -LAMBDA is a lambda expression which is evaled with the text of the +LAMBDA is a lambda expression which is evalled with the text of the type when it is found. It is passed the list of all buffer text elements found since the last lambda expression. It should return a semantic element (see below.) === modified file 'admin/grammars/js.wy' --- admin/grammars/js.wy 2011-08-04 00:58:07 +0000 +++ admin/grammars/js.wy 2011-12-19 06:21:24 +0000 @@ -66,7 +66,7 @@ ;; Other Goals %start FormalParameterList -;; with the terminals stuff, I used the javacript.y names, +;; with the terminals stuff, I used the javascript.y names, ;; but the semantic/wisent/java-tags.wy types ;; when possible ;; ------------------ === modified file 'doc/lispref/spellfile' --- doc/lispref/spellfile 2011-11-27 04:43:11 +0000 +++ doc/lispref/spellfile 2011-12-19 06:21:24 +0000 @@ -337,7 +337,6 @@ fstab ftp fu -funtions garbles gc gcpro === modified file 'doc/misc/idlwave.texi' --- doc/misc/idlwave.texi 2011-12-04 08:02:42 +0000 +++ doc/misc/idlwave.texi 2011-12-19 06:21:24 +0000 @@ -669,7 +669,7 @@ tutorial. This was the invoked using @kbd{C-c ?}, and displays information about the IDL routine near the cursor position. Wouldn't it be nice to have the same kind of information available for your own -routines and for the huge amount of code in major libraries like JHUPL +routines and for the huge amount of code in major libraries like JHUAPL or the IDL-Astro library? In many cases, you may already have this information. Files named @file{.idlwave_catalog} in library directories contain scanned information on the routines in that directory; many === modified file 'etc/NEWS.19' --- etc/NEWS.19 2011-12-04 08:02:42 +0000 +++ etc/NEWS.19 2011-12-19 06:21:24 +0000 @@ -6114,7 +6114,7 @@ 1. This copies the text from the right-hand buffer as a second column in the other buffer. To go back to two-column editing, use C-x 6 s. -Use C-x 6 d to disassociate the two buffers, leaving each as it +Use C-x 6 d to dissociate the two buffers, leaving each as it stands. (If the other buffer, the one that was not current when you type C-x 6 d, is empty, C-x 6 d kills it.) === modified file 'leim/ChangeLog' --- leim/ChangeLog 2011-12-15 07:50:05 +0000 +++ leim/ChangeLog 2011-12-19 06:21:24 +0000 @@ -1895,7 +1895,7 @@ * Makefile.in (${TIT}): To byte-compile quail packages, use just built quail. -1997-12-09 Koaunghi Un +1997-12-09 Koaunghi Un * quail/hanja3.el: New file. === modified file 'leim/quail/hanja3.el' --- leim/quail/hanja3.el 2011-01-26 08:36:39 +0000 +++ leim/quail/hanja3.el 2011-12-19 06:21:24 +0000 @@ -2,7 +2,7 @@ ;; Copyright (C) 1997, 1999, 2001-2011 Free Software Foundation, Inc. -;; Author: Koaunghi Un +;; Author: Koaunghi Un ;; Keywords: mule, quail, multilingual, input method, Korean, Hanja ;; This file is part of GNU Emacs. === modified file 'lisp/ChangeLog.12' --- lisp/ChangeLog.12 2011-12-06 01:30:54 +0000 +++ lisp/ChangeLog.12 2011-12-19 06:21:24 +0000 @@ -18459,7 +18459,7 @@ reveal-open-spots, so as to be more reliable. There were several tricky corner cases where an open spot might be lost, or where a closed spot might end up on the list of open spots. - Only reveal text that's ellipsised. + Only reveal text that's ellipsized. 2005-11-07 Carsten Dominik === modified file 'lisp/allout.el' --- lisp/allout.el 2011-12-05 08:55:25 +0000 +++ lisp/allout.el 2011-12-19 06:21:24 +0000 @@ -3334,7 +3334,7 @@ (run-hooks 'allout-post-undo-hook) (cond ((and (= buffer-saved-size -1) allout-auto-save-temporarily-disabled) - ;; user possibly undid a decryption, deinhibit auto-save: + ;; user possibly undid a decryption, disinhibit auto-save: (allout-maybe-resume-auto-save-info-after-encryption)) ((save-excursion (save-restriction @@ -5871,7 +5871,7 @@ Further, encrypting with a KEYMODE-CUE universal argument greater than 4 - eg, preceded by a doubled Ctrl-U - causes association of the specified recipients with the file, replacing those currently -associated with it. This can be used to deassociate any +associated with it. This can be used to dissociate any recipients with the file, by selecting no recipients in the dialog. @@ -5912,7 +5912,7 @@ Further, encrypting with a KEYMODE-CUE universal argument greater than 4 - eg, preceded by a doubled Ctrl-U - causes association of the specified recipients with the file, replacing those currently -associated with it. This can be used to deassociate any +associated with it. This can be used to dissociate any recipients with the file, by selecting no recipients in the dialog. @@ -6045,7 +6045,7 @@ Further, encrypting with a KEYMODE-CUE universal argument greater than 4 - eg, preceded by a doubled Ctrl-U - causes association of the specified recipients with the file, replacing those currently -associated with it. This can be used to deassociate any +associated with it. This can be used to dissociate any recipients with the file, by selecting no recipients in the dialog. @@ -6661,7 +6661,7 @@ (if (/= arg 1) (condition-case nil (line-move (1- arg)) (error nil))) - ;; Move to beginning-of-line, ignoring fields and invisibles. + ;; Move to beginning-of-line, ignoring fields and invisible text. (skip-chars-backward "^\n") (while (and (not (bobp)) (let ((prop === modified file 'lisp/cedet/data-debug.el' --- lisp/cedet/data-debug.el 2011-11-20 03:48:53 +0000 +++ lisp/cedet/data-debug.el 2011-12-19 06:21:24 +0000 @@ -1060,11 +1060,11 @@ (setq values (cons (eval expr) values)) (let ((old-value (make-symbol "t")) new-value) ;; Bind debug-on-error to something unique so that we can - ;; detect when evaled code changes it. + ;; detect when evalled code changes it. (let ((debug-on-error old-value)) (setq values (cons (eval expr) values)) (setq new-value debug-on-error)) - ;; If evaled code has changed the value of debug-on-error, + ;; If evalled code has changed the value of debug-on-error, ;; propagate that change to the global binding. (unless (eq old-value new-value) (setq debug-on-error new-value)))) === modified file 'lisp/cedet/semantic/analyze/debug.el' --- lisp/cedet/semantic/analyze/debug.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/semantic/analyze/debug.el 2011-12-19 06:21:24 +0000 @@ -70,7 +70,7 @@ (let ((pentry (nth idx pf)) (ptentry (nth idx pft))) (if (or (stringp pentry) (not ptentry)) - ;; Found someting ok. stop + ;; Found something ok. Stop. (setq stop t) (setq idx (1+ idx))))) ;; We found the first non-tag entry. What is the situation? === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2011-11-27 04:43:11 +0000 +++ lisp/emacs-lisp/bytecomp.el 2011-12-19 06:21:24 +0000 @@ -2637,7 +2637,7 @@ (setq form (cdr form))) (setq form (car form))) (if (and (eq (car-safe form) 'list) - ;; The spec is evaled in callint.c in dynamic-scoping + ;; The spec is evalled in callint.c in dynamic-scoping ;; mode, so just leaving the form unchanged would mean ;; it won't be eval'd in the right mode. (not lexical-binding)) === modified file 'lisp/font-lock.el' --- lisp/font-lock.el 2011-11-20 07:30:16 +0000 +++ lisp/font-lock.el 2011-12-19 06:21:24 +0000 @@ -294,7 +294,7 @@ ;; and they give users another mechanism for changing face appearance. ;; We now allow a FACENAME in `font-lock-keywords' to be any expression that ;; returns a face. So the easiest thing is to continue using these variables, -;; rather than sometimes evaling FACENAME and sometimes not. sm. +;; rather than sometimes evalling FACENAME and sometimes not. sm. ;; Note that in new code, in the vast majority of cases there is no ;; need to create variables that specify face names. Simply using === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-12-15 23:35:40 +0000 +++ lisp/gnus/ChangeLog 2011-12-19 06:21:24 +0000 @@ -21339,7 +21339,7 @@ (gnus-agent-cat-groups): Use eval-and-compile, not eval-when-compile, to define gnus-agent-set-cat-groups as the setf method of gnus-agent-cat-groups even when the buffer has been - evaled. + evalled. (gnus-agent-save-active, gnus-agent-save-active-1): Merge to delete gnus-agent-save-active-1. (gnus-agent-save-groups): Delete. Identical to === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-12-02 04:00:32 +0000 +++ lisp/gnus/gnus-art.el 2011-12-19 06:21:24 +0000 @@ -669,7 +669,7 @@ If the match is a string, it is used as a regexp match on the article. If the match is a symbol, that symbol will be funcalled from the buffer of the article to be saved with the newsgroup as the -parameter. If it is a list, it will be evaled in the same buffer. +parameter. If it is a list, it will be evalled in the same buffer. If this form or function returns a string, this string will be used as a possible file name; and if it returns a non-nil list, that list will be === modified file 'lisp/gnus/gnus-msg.el' --- lisp/gnus/gnus-msg.el 2011-12-04 08:02:42 +0000 +++ lisp/gnus/gnus-msg.el 2011-12-19 06:21:24 +0000 @@ -1784,7 +1784,7 @@ (and header (string-match (nth 2 match) header))))))) (t - ;; This is a form to be evaled. + ;; This is a form to be evalled. (eval match))))) ;; We have a match, so we set the variables. (dolist (attribute style) === modified file 'lisp/gnus/gnus-spec.el' --- lisp/gnus/gnus-spec.el 2011-09-10 23:30:53 +0000 +++ lisp/gnus/gnus-spec.el 2011-12-19 06:21:24 +0000 @@ -52,7 +52,7 @@ (defvar gnus-group-indentation "") ;; Format specs. The chunks below are the machine-generated forms -;; that are to be evaled as the result of the default format strings. +;; that are to be evalled as the result of the default format strings. ;; We write them in here to get them byte-compiled. That way the ;; default actions will be quite fast, while still retaining the full ;; flexibility of the user-defined format specs. @@ -690,7 +690,7 @@ (not (and (featurep 'xemacs) gnus-use-correct-string-widths))) (insert (number-to-string pad-width))) - ;; Create the form to be evaled. + ;; Create the form to be evalled. (if (or max-width cut-width ignore-value (and (featurep 'xemacs) gnus-use-correct-string-widths)) === modified file 'lisp/gnus/gnus-win.el' --- lisp/gnus/gnus-win.el 2011-11-14 20:23:26 +0000 +++ lisp/gnus/gnus-win.el 2011-12-19 06:21:24 +0000 @@ -242,7 +242,7 @@ (let* ((current-window (or (get-buffer-window (current-buffer)) (selected-window))) (window (or window current-window))) (select-window window) - ;; The SPLIT might be something that is to be evaled to + ;; The SPLIT might be something that is to be evalled to ;; return a new SPLIT. (while (and (not (assq (car split) gnus-window-to-buffer)) (symbolp (car split)) (fboundp (car split))) @@ -447,7 +447,7 @@ (when (consp (car split)) (push 1.0 split) (push 'vertical split)) - ;; The SPLIT might be something that is to be evaled to + ;; The SPLIT might be something that is to be evalled to ;; return a new SPLIT. (while (and (not (assq (car split) gnus-window-to-buffer)) (symbolp (car split)) (fboundp (car split))) === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2011-12-14 21:05:20 +0000 +++ lisp/gnus/message.el 2011-12-19 06:21:24 +0000 @@ -4409,7 +4409,7 @@ ;; A simple function. ((functionp action) (funcall action)) - ;; Something to be evaled. + ;; Something to be evalled. (t (eval action)))))) === modified file 'lisp/mail/rmailmm.el' --- lisp/mail/rmailmm.el 2011-11-24 03:59:09 +0000 +++ lisp/mail/rmailmm.el 2011-12-19 06:21:24 +0000 @@ -320,7 +320,7 @@ (setq index 2)) ;; If the tagline is displayed, get past it to the body. (if (rmail-mime-display-tagline current) - ;; The next foward-line call must be in sync with how + ;; The next forward-line call must be in sync with how ;; `rmail-mime-insert-tagline' formats the tagline. The ;; body begins after the empty line that ends the tagline. (forward-line 3)) === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2011-11-27 04:43:11 +0000 +++ lisp/progmodes/sql.el 2011-12-19 06:21:24 +0000 @@ -4224,7 +4224,7 @@ "^\\(.+\\) (hex ..)$" "SET \\1") - ;; FEDDBACK ON for 99 or more rows + ;; FEEDBACK ON for 99 or more rows ;; feedback OFF (sql-redirect-value sqlbuf === modified file 'lisp/progmodes/verilog-mode.el' --- lisp/progmodes/verilog-mode.el 2011-12-17 06:51:13 +0000 +++ lisp/progmodes/verilog-mode.el 2011-12-19 06:21:24 +0000 @@ -10932,7 +10932,7 @@ (defun verilog-auto-logic () "Expand AUTOLOGIC statements, as part of \\[verilog-auto]. Make wire statements using the SystemVerilog logic keyword. -This is currently equivelent to: +This is currently equivalent to: /*AUTOWIRE*/ === modified file 'lisp/reveal.el' --- lisp/reveal.el 2011-12-05 08:55:25 +0000 +++ lisp/reveal.el 2011-12-19 06:21:24 +0000 @@ -106,7 +106,7 @@ (let ((inv (overlay-get ol 'invisible)) open) (when (and inv ;; There's an `invisible' property. Make sure it's - ;; actually invisible, and ellipsised. + ;; actually invisible, and ellipsized. (and (consp buffer-invisibility-spec) (cdr (assq inv buffer-invisibility-spec))) (or (setq open === modified file 'lisp/simple.el' --- lisp/simple.el 2011-12-09 03:12:38 +0000 +++ lisp/simple.el 2011-12-19 06:21:24 +0000 @@ -1225,11 +1225,11 @@ (push (eval eval-expression-arg lexical-binding) values) (let ((old-value (make-symbol "t")) new-value) ;; Bind debug-on-error to something unique so that we can - ;; detect when evaled code changes it. + ;; detect when evalled code changes it. (let ((debug-on-error old-value)) (push (eval eval-expression-arg lexical-binding) values) (setq new-value debug-on-error)) - ;; If evaled code has changed the value of debug-on-error, + ;; If evalled code has changed the value of debug-on-error, ;; propagate that change to the global binding. (unless (eq old-value new-value) (setq debug-on-error new-value)))) @@ -4729,7 +4729,7 @@ (let ((line-move-visual nil)) (line-move (1- arg) t))) - ;; Move to beginning-of-line, ignoring fields and invisibles. + ;; Move to beginning-of-line, ignoring fields and invisible text. (skip-chars-backward "^\n") (while (and (not (bobp)) (invisible-p (1- (point)))) (goto-char (previous-char-property-change (point))) === modified file 'lisp/textmodes/rst.el' --- lisp/textmodes/rst.el 2011-11-27 04:43:11 +0000 +++ lisp/textmodes/rst.el 2011-12-19 06:21:24 +0000 @@ -243,7 +243,7 @@ (define-key map [(control ?=)] 'rst-adjust) ;; (Does not work on the Mac OSX.) ;; Display the hierarchy of decorations implied by the current document contents. (define-key map [(control c) (control h)] 'rst-display-decorations-hierarchy) - ;; Homogeneize the decorations in the document. + ;; Homogenize the decorations in the document. (define-key map [(control c) (control s)] 'rst-straighten-decorations) ;; (define-key map [(control c) (control s)] 'rst-straighten-deco-spacing) === modified file 'lisp/textmodes/texnfo-upd.el' --- lisp/textmodes/texnfo-upd.el 2011-12-10 12:22:25 +0000 +++ lisp/textmodes/texnfo-upd.el 2011-12-19 06:21:24 +0000 @@ -1165,7 +1165,7 @@ "texinfo-specific-section-type: Chapter or section not found")))))) (defun texinfo-hierarchic-level () - "Return the general hierarchal level of the next node in a texinfo file. + "Return the general hierarchical level of the next node in a texinfo file. Thus, a subheading or appendixsubsec is of type subsection." (let ((case-fold-search t)) (cadr (assoc === modified file 'lisp/vc/vc-hg.el' --- lisp/vc/vc-hg.el 2011-03-15 17:39:56 +0000 +++ lisp/vc/vc-hg.el 2011-12-19 06:21:24 +0000 @@ -216,7 +216,7 @@ ((eq state ?R) 'removed) ((eq state ?!) 'missing) ((eq state ??) 'unregistered) - ((eq state ?C) 'up-to-date) ;; Older mercurials use this + ((eq state ?C) 'up-to-date) ;; Older mercurial versions use this. (t 'up-to-date))))))) (defun vc-hg-working-revision (file) === modified file 'src/ccl.c' --- src/ccl.c 2011-12-04 08:02:42 +0000 +++ src/ccl.c 2011-12-19 06:21:24 +0000 @@ -210,8 +210,8 @@ #define CCL_WriteArrayReadJump 0x0B /* Write an array element, read, and jump: 1:A--D--D--R--E--S--S-rrrXXXXX 2:LENGTH - 3:ELEMENET[0] - 4:ELEMENET[1] + 3:ELEMENT[0] + 4:ELEMENT[1] ... N:A--D--D--R--E--S--S-rrrYYYYY ------------------------------ === modified file 'src/w32term.c' --- src/w32term.c 2011-12-17 06:51:13 +0000 +++ src/w32term.c 2011-12-19 06:21:24 +0000 @@ -3556,7 +3556,7 @@ /* Destroy the window. */ my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar)); - /* Disassociate this scroll bar from its window. */ + /* Dissociate this scroll bar from its window. */ XWINDOW (bar->window)->vertical_scroll_bar = Qnil; UNBLOCK_INPUT; === modified file 'src/xterm.c' --- src/xterm.c 2011-12-10 22:53:28 +0000 +++ src/xterm.c 2011-12-19 06:21:24 +0000 @@ -5151,7 +5151,7 @@ XDestroyWindow (FRAME_X_DISPLAY (f), bar->x_window); #endif - /* Disassociate this scroll bar from its window. */ + /* Dissociate this scroll bar from its window. */ XWINDOW (bar->window)->vertical_scroll_bar = Qnil; UNBLOCK_INPUT; === modified file 'test/indent/prolog.prolog' --- test/indent/prolog.prolog 2011-01-13 20:53:06 +0000 +++ test/indent/prolog.prolog 2011-12-19 06:21:24 +0000 @@ -200,7 +200,7 @@ elaborate(let(F,T,app(fix,lambda(F,T,B)),E), Env, Ee). %% elab_bindings(+TS, +Env, -TS). -%% Applique `elaborate' sur l'environnment de type TS. +%% Applique `elaborate' sur l'environnement de type TS. elab_tenv([], _, []). elab_tenv([(X,T)|TS], Env, [(X, Tg)|TSe]) :- elaborate(T, Env, Te), ------------------------------------------------------------ revno: 106696 committer: Jan D. branch nick: trunk timestamp: Sun 2011-12-18 15:53:01 +0100 message: Fix spelling AquaEmacs => Aquamacs diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-18 14:50:19 +0000 +++ src/ChangeLog 2011-12-18 14:53:01 +0000 @@ -7,9 +7,9 @@ * nsmenu.m (trackingMenu): New variable. (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5 and NS_IMPL_COCOA. - (trackingNotification): New method (from AquaEmacs). + (trackingNotification): New method (from Aquamacs). (menuNeedsUpdate): Expand comment and return if trackingMenu is 0, - from AquaEmacs (Bug#7030). + from Aquamacs (Bug#7030). (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA. * nsselect.m (CUT_BUFFER_SUPPORT): Remove define. ------------------------------------------------------------ revno: 106695 fixes bug(s): http://debbugs.gnu.org/7030 committer: Jan D. branch nick: trunk timestamp: Sun 2011-12-18 15:50:19 +0100 message: Adapt code from AquaEmacs to handle occasional blank menus. * nsmenu.m (trackingMenu): New variable. (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5 and NS_IMPL_COCOA. (trackingNotification): New method (from AquaEmacs). (menuNeedsUpdate): Expand comment and return if trackingMenu is 0, from AquaEmacs. (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA. * nsterm.m (ns_term_init): Subscribe for notifications NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification to method trackingNotification in EmacsMenu. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-18 13:49:38 +0000 +++ src/ChangeLog 2011-12-18 14:50:19 +0000 @@ -1,5 +1,17 @@ 2011-12-18 Jan Djärv + * nsterm.m (ns_term_init): Subscribe for notifications + NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification + to method trackingNotification in EmacsMenu. + + * nsmenu.m (trackingMenu): New variable. + (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5 and + NS_IMPL_COCOA. + (trackingNotification): New method (from AquaEmacs). + (menuNeedsUpdate): Expand comment and return if trackingMenu is 0, + from AquaEmacs (Bug#7030). + (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA. + * nsselect.m (CUT_BUFFER_SUPPORT): Remove define. (symbol_to_nsstring): Fix indentation. (ns_symbol_to_pb): New function. === modified file 'src/nsmenu.m' --- src/nsmenu.m 2011-07-29 05:31:12 +0000 +++ src/nsmenu.m 2011-12-18 14:50:19 +0000 @@ -74,6 +74,10 @@ static int popup_activated_flag; static NSModalSession popupSession; +/* Nonzero means we are tracking and updating menus. */ +static int trackingMenu; + + /* NOTE: toolbar implementation is at end, following complete menu implementation. */ @@ -543,21 +547,44 @@ frame = f; } +#ifdef NS_IMPL_COCOA +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 +extern NSString *NSMenuDidBeginTrackingNotification; +#endif +#endif + +#ifdef NS_IMPL_COCOA +-(void)trackingNotification:(NSNotification *)notification +{ + /* Update menu in menuNeedsUpdate only while tracking menus. */ + trackingMenu = ([notification name] == NSMenuDidBeginTrackingNotification + ? 1 : 0); +} +#endif /* delegate method called when a submenu is being opened: run a 'deep' call to set_frame_menubar */ - (void)menuNeedsUpdate: (NSMenu *)menu { - NSEvent *event; if (!FRAME_LIVE_P (frame)) return; - event = [[FRAME_NS_VIEW (frame) window] currentEvent]; - /* HACK: Cocoa/Carbon will request update on every keystroke + + /* Cocoa/Carbon will request update on every keystroke via IsMenuKeyEvent -> CheckMenusForKeyEvent. These are not needed since key equivalents are handled through emacs. - On Leopard, even keystroke events generate SystemDefined events, but - their subtype is 8. */ - if ([event type] != NSSystemDefined || [event subtype] == 8 + On Leopard, even keystroke events generate SystemDefined event. + Third-party applications that enhance mouse / trackpad + interaction, or also VNC/Remote Desktop will send events + of type AppDefined rather than SysDefined. + Menus will fail to show up if they haven't been initialized. + AppDefined events may lack timing data. + + Thus, we rely on the didBeginTrackingNotification notification + as above to indicate the need for updates. + From 10.6 on, we could also use -[NSMenu propertiesToUpdate]: In the + key press case, NSMenuPropertyItemImage (e.g.) won't be set. + */ + if (trackingMenu == 0 /* Also, don't try this if from an event picked up asynchronously, as lots of lisp evaluation happens in ns_update_menubar. */ || handling_signal != 0) @@ -1795,6 +1822,11 @@ void syms_of_nsmenu (void) { +#ifndef NS_IMPL_COCOA + /* Don't know how to keep track of this in Next/Open/Gnustep. Always + update menus there. */ + trackingMenu = 1; +#endif defsubr (&Sx_popup_dialog); defsubr (&Sns_reset_menu); defsubr (&Smenu_or_popup_active_p); === modified file 'src/nsterm.m' --- src/nsterm.m 2011-12-10 14:01:08 +0000 +++ src/nsterm.m 2011-12-18 14:50:19 +0000 @@ -4203,6 +4203,15 @@ [NSApp setServicesMenu: svcsMenu]; /* Needed at least on Cocoa, to get dock menu to show windows */ [NSApp setWindowsMenu: [[NSMenu alloc] init]]; + + [[NSNotificationCenter defaultCenter] + addObserver: mainMenu + selector: @selector (trackingNotification:) + name: NSMenuDidBeginTrackingNotification object: mainMenu]; + [[NSNotificationCenter defaultCenter] + addObserver: mainMenu + selector: @selector (trackingNotification:) + name: NSMenuDidEndTrackingNotification object: mainMenu]; } #endif /* MAC OS X menu setup */ ------------------------------------------------------------ revno: 106694 committer: Jan D. branch nick: trunk timestamp: Sun 2011-12-18 14:49:38 +0100 message: NS selection bug fix and cleanup, see thread C-g crash in C-x C-f (OSX Lion). Thread is on emacs-devel. * lisp/term/ns-win.el (ns-get-selection-internal) (ns-store-selection-internal): Declare. (ns-store-cut-buffer-internal, ns-get-cut-buffer-internal): Declare as obsolete. (ns-get-pasteboard, ns-paste-secondary): Use ns-get-selection-internal. (ns-set-pasteboard, ns-copy-including-secondary): Use ns-store-selection-internal. * src/nsselect.m (CUT_BUFFER_SUPPORT): Remove define. (symbol_to_nsstring): Fix indentation. (ns_symbol_to_pb): New function. (Fns_get_selection_internal): Renamed from Fns_get_cut_buffer_internal. (Fns_rotate_cut_buffers_internal): Removed. (Fns_store_selection_internal): Renamed from Fns_store_cut_buffer_internal. (ns_get_foreign_selection, Fx_own_selection_internal) (Fx_disown_selection_internal, Fx_selection_exists_p) (Fns_get_selection_internal, Fns_store_selection_internal): Use ns_symbol_to_pb and check if return value is nil. (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal renamed to Sns_store_selection_internal. (ns_handle_selection_request): Move code to Fx_own_selection_internal and remove this function. (ns_handle_selection_clear): Remove, never used. (Fx_own_selection_internal): Move code from ns_handle_selection_request here. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-17 07:50:08 +0000 +++ lisp/ChangeLog 2011-12-18 13:49:38 +0000 @@ -1,3 +1,14 @@ +2011-12-18 Jan Djärv + + * term/ns-win.el (ns-get-selection-internal) + (ns-store-selection-internal): Declare. + (ns-store-cut-buffer-internal, ns-get-cut-buffer-internal): Declare + as obsolete. + (ns-get-pasteboard, ns-paste-secondary): Use + ns-get-selection-internal. + (ns-set-pasteboard, ns-copy-including-secondary): Use + ns-store-selection-internal. + 2011-12-17 Chong Yidong * vc/vc.el (vc-next-action): Doc fix; remove CVS-isms. === modified file 'lisp/term/ns-win.el' --- lisp/term/ns-win.el 2011-11-23 07:03:56 +0000 +++ lisp/term/ns-win.el 2011-12-18 13:49:38 +0000 @@ -702,19 +702,24 @@ ;;;; Pasteboard support. -(declare-function ns-get-cut-buffer-internal "nsselect.m" (buffer)) +(declare-function ns-get-selection-internal "nsselect.m" (buffer)) +(declare-function ns-store-selection-internal "nsselect.m" (buffer string)) + +(define-obsolete-function-alias 'ns-get-cut-buffer-internal + 'ns-get-selection-internal "24.1") +(define-obsolete-function-alias 'ns-store-cut-buffer-internal + 'ns-store-selection-internal "24.1") + (defun ns-get-pasteboard () "Returns the value of the pasteboard." - (ns-get-cut-buffer-internal 'CLIPBOARD)) - -(declare-function ns-store-cut-buffer-internal "nsselect.m" (buffer string)) + (ns-get-selection-internal 'CLIPBOARD)) (defun ns-set-pasteboard (string) "Store STRING into the pasteboard of the Nextstep display server." ;; Check the data type of STRING. (if (not (stringp string)) (error "Nonstring given to pasteboard")) - (ns-store-cut-buffer-internal 'CLIPBOARD string)) + (ns-store-selection-internal 'CLIPBOARD string)) ;; We keep track of the last text selected here, so we can check the ;; current selection against it, and avoid passing back our own text @@ -742,11 +747,11 @@ (defun ns-copy-including-secondary () (interactive) (call-interactively 'kill-ring-save) - (ns-store-cut-buffer-internal 'SECONDARY - (buffer-substring (point) (mark t)))) + (ns-store-selection-internal 'SECONDARY + (buffer-substring (point) (mark t)))) (defun ns-paste-secondary () (interactive) - (insert (ns-get-cut-buffer-internal 'SECONDARY))) + (insert (ns-get-selection-internal 'SECONDARY))) ;;;; Scrollbar handling. === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-17 17:00:49 +0000 +++ src/ChangeLog 2011-12-18 13:49:38 +0000 @@ -1,3 +1,26 @@ +2011-12-18 Jan Djärv + + * nsselect.m (CUT_BUFFER_SUPPORT): Remove define. + (symbol_to_nsstring): Fix indentation. + (ns_symbol_to_pb): New function. + (Fns_get_selection_internal): Renamed from Fns_get_cut_buffer_internal. + (Fns_rotate_cut_buffers_internal): Removed. + (Fns_store_selection_internal): Renamed from + Fns_store_cut_buffer_internal. + (ns_get_foreign_selection, Fx_own_selection_internal) + (Fx_disown_selection_internal, Fx_selection_exists_p) + (Fns_get_selection_internal, Fns_store_selection_internal): Use + ns_symbol_to_pb and check if return value is nil. + (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove + defsubr Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal + renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal + renamed to Sns_store_selection_internal. + (ns_handle_selection_request): Move code to Fx_own_selection_internal + and remove this function. + (ns_handle_selection_clear): Remove, never used. + (Fx_own_selection_internal): Move code from ns_handle_selection_request + here. + 2011-12-17 Ken Brown * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or === modified file 'src/nsselect.m' --- src/nsselect.m 2011-07-08 10:04:23 +0000 +++ src/nsselect.m 2011-12-18 13:49:38 +0000 @@ -35,8 +35,6 @@ #include "termhooks.h" #include "keyboard.h" -#define CUT_BUFFER_SUPPORT - Lisp_Object QCLIPBOARD, QSECONDARY, QTEXT, QFILE_NAME; static Lisp_Object Vselection_alist; @@ -60,13 +58,18 @@ symbol_to_nsstring (Lisp_Object sym) { CHECK_SYMBOL (sym); - if (EQ (sym, QCLIPBOARD)) return NSGeneralPboard; + if (EQ (sym, QCLIPBOARD)) return NSGeneralPboard; if (EQ (sym, QPRIMARY)) return NXPrimaryPboard; if (EQ (sym, QSECONDARY)) return NXSecondaryPboard; if (EQ (sym, QTEXT)) return NSStringPboardType; return [NSString stringWithUTF8String: SDATA (XSYMBOL (sym)->xname)]; } +static NSPasteboard * +ns_symbol_to_pb (Lisp_Object symbol) +{ + return [NSPasteboard pasteboardWithName: symbol_to_nsstring (symbol)]; +} static Lisp_Object ns_string_to_symbol (NSString *t) @@ -230,69 +233,10 @@ ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target) { id pb; - pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (symbol)]; - return ns_string_from_pasteboard (pb); -} - - -static void -ns_handle_selection_request (struct input_event *event) -{ - // FIXME: BIG UGLY HACK!!! - id pb = (id)*(EMACS_INT*)&(event->x); - NSString *type = (NSString *)*(EMACS_INT*)&(event->y); - Lisp_Object selection_name, selection_data, target_symbol, data; - Lisp_Object successful_p, rest; - - selection_name = ns_string_to_symbol ([(NSPasteboard *)pb name]); - target_symbol = ns_string_to_symbol (type); - selection_data = assq_no_quit (selection_name, Vselection_alist); - successful_p = Qnil; - - if (!NILP (selection_data)) - { - data = ns_get_local_selection (selection_name, target_symbol); - if (!NILP (data)) - { - if (STRINGP (data)) - ns_string_to_pasteboard_internal (pb, data, type); - successful_p = Qt; - } - } - - if (!EQ (Vns_sent_selection_hooks, Qunbound)) - { - for (rest = Vns_sent_selection_hooks; CONSP (rest); rest = Fcdr (rest)) - call3 (Fcar (rest), selection_name, target_symbol, successful_p); - } -} - - -static void -ns_handle_selection_clear (struct input_event *event) -{ - id pb = (id)*(EMACS_INT*)&(event->x); - Lisp_Object selection_name, selection_data, rest; - - selection_name = ns_string_to_symbol ([(NSPasteboard *)pb name]); - selection_data = assq_no_quit (selection_name, Vselection_alist); - if (NILP (selection_data)) return; - - if (EQ (selection_data, Fcar (Vselection_alist))) - Vselection_alist = Fcdr (Vselection_alist); - else - { - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) - if (EQ (selection_data, Fcar (Fcdr (rest)))) - Fsetcdr (rest, Fcdr (Fcdr (rest))); - } - - if (!EQ (Vns_lost_selection_hooks, Qunbound)) - { - for (rest = Vns_lost_selection_hooks;CONSP (rest); rest = Fcdr (rest)) - call1 (Fcar (rest), selection_name); - } -} + pb = ns_symbol_to_pb (symbol); + return pb != nil ? ns_string_from_pasteboard (pb) : Qnil; +} + @@ -401,29 +345,44 @@ { id pb; Lisp_Object old_value, new_value; + NSString *type; + Lisp_Object successful_p = Qnil, rest; + Lisp_Object target_symbol, data; + check_ns (); CHECK_SYMBOL (selection_name); if (NILP (selection_value)) error ("selection-value may not be nil."); - pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (selection_name)]; + pb = ns_symbol_to_pb (selection_name); + if (pb == nil) return Qnil; + ns_declare_pasteboard (pb); old_value = assq_no_quit (selection_name, Vselection_alist); new_value = Fcons (selection_name, Fcons (selection_value, Qnil)); + if (NILP (old_value)) Vselection_alist = Fcons (new_value, Vselection_alist); else Fsetcdr (old_value, Fcdr (new_value)); - /* XXX An evil hack, but a necessary one I fear XXX */ - { - struct input_event ev; - ev.kind = SELECTION_REQUEST_EVENT; - ev.modifiers = 0; - ev.code = 0; - *(EMACS_INT*)(&(ev.x)) = (EMACS_INT)pb; // FIXME: BIG UGLY HACK!! - *(EMACS_INT*)(&(ev.y)) = (EMACS_INT)NSStringPboardType; - ns_handle_selection_request (&ev); - } + + /* We only support copy of text. */ + type = NSStringPboardType; + target_symbol = ns_string_to_symbol (type); + data = ns_get_local_selection (selection_name, target_symbol); + if (!NILP (data)) + { + if (STRINGP (data)) + ns_string_to_pasteboard_internal (pb, data, type); + successful_p = Qt; + } + + if (!EQ (Vns_sent_selection_hooks, Qunbound)) + { + for (rest = Vns_sent_selection_hooks; CONSP (rest); rest = Fcdr (rest)) + call3 (Fcar (rest), selection_name, target_symbol, successful_p); + } + return selection_value; } @@ -438,8 +397,8 @@ CHECK_SYMBOL (selection_name); if (NILP (assq_no_quit (selection_name, Vselection_alist))) return Qnil; - pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (selection_name)]; - ns_undeclare_pasteboard (pb); + pb = ns_symbol_to_pb (selection_name); + if (pb != nil) ns_undeclare_pasteboard (pb); return Qt; } @@ -460,8 +419,10 @@ CHECK_SYMBOL (selection); if (EQ (selection, Qnil)) selection = QPRIMARY; if (EQ (selection, Qt)) selection = QSECONDARY; - pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (selection)]; - types =[pb types]; + pb = ns_symbol_to_pb (selection); + if (pb == nil) return Qnil; + + types = [pb types]; return ([types count] == 0) ? Qnil : Qt; } @@ -511,45 +472,31 @@ } -#ifdef CUT_BUFFER_SUPPORT -DEFUN ("ns-get-cut-buffer-internal", Fns_get_cut_buffer_internal, - Sns_get_cut_buffer_internal, 1, 1, 0, - doc: /* Returns the value of the named cut buffer. */) - (Lisp_Object buffer) -{ - id pb; - check_ns (); - pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (buffer)]; - return ns_string_from_pasteboard (pb); -} - - -DEFUN ("ns-rotate-cut-buffers-internal", Fns_rotate_cut_buffers_internal, - Sns_rotate_cut_buffers_internal, 1, 1, 0, - doc: /* Rotate the values of the cut buffers by N steps. -Positive N means move values forward, negative means -backward. CURRENTLY NOT IMPLEMENTED UNDER NEXTSTEP. */ ) - (Lisp_Object n) -{ - /* XXX This function is unimplemented under NeXTstep XXX */ - Fsignal (Qquit, Fcons (build_string ( - "Warning: ns-rotate-cut-buffers-internal not implemented\n"), Qnil)); - return Qnil; -} - - -DEFUN ("ns-store-cut-buffer-internal", Fns_store_cut_buffer_internal, - Sns_store_cut_buffer_internal, 2, 2, 0, - doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */) - (Lisp_Object buffer, Lisp_Object string) -{ - id pb; - check_ns (); - pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (buffer)]; - ns_string_to_pasteboard (pb, string); - return Qnil; -} -#endif +DEFUN ("ns-get-selection-internal", Fns_get_selection_internal, + Sns_get_selection_internal, 1, 1, 0, + doc: /* Returns the value of SELECTION as a string. +SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. */) + (Lisp_Object selection) +{ + id pb; + check_ns (); + pb = ns_symbol_to_pb (selection); + return pb != nil ? ns_string_from_pasteboard (pb) : Qnil; +} + + +DEFUN ("ns-store-selection-internal", Fns_store_selection_internal, + Sns_store_selection_internal, 2, 2, 0, + doc: /* Sets the string value of SELECTION. +SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. */) + (Lisp_Object selection, Lisp_Object string) +{ + id pb; + check_ns (); + pb = ns_symbol_to_pb (selection); + if (pb != nil) ns_string_to_pasteboard (pb, string); + return Qnil; +} void @@ -572,11 +519,8 @@ defsubr (&Sx_own_selection_internal); defsubr (&Sx_selection_exists_p); defsubr (&Sx_selection_owner_p); -#ifdef CUT_BUFFER_SUPPORT - defsubr (&Sns_get_cut_buffer_internal); - defsubr (&Sns_rotate_cut_buffers_internal); - defsubr (&Sns_store_cut_buffer_internal); -#endif + defsubr (&Sns_get_selection_internal); + defsubr (&Sns_store_selection_internal); Vselection_alist = Qnil; staticpro (&Vselection_alist); ------------------------------------------------------------ revno: 106693 committer: Ken Brown branch nick: trunk timestamp: Sat 2011-12-17 12:00:49 -0500 message: * src/fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or GID is unknown (Bug#10257). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-17 01:05:26 +0000 +++ src/ChangeLog 2011-12-17 17:00:49 +0000 @@ -1,3 +1,8 @@ +2011-12-17 Ken Brown + + * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or + GID is unknown (Bug#10257). + 2011-12-17 Paul Eggert * s/gnu-linux.h: Fix mark_memory typo (Bug#10286). === modified file 'src/fileio.c' --- src/fileio.c 2011-12-05 08:55:25 +0000 +++ src/fileio.c 2011-12-17 17:00:49 +0000 @@ -2416,15 +2416,27 @@ return (st.st_mode & S_IWRITE || S_ISDIR (st.st_mode)); #else /* not MSDOS */ #ifdef HAVE_EUIDACCESS - return (euidaccess (filename, 2) >= 0); -#else + int res = (euidaccess (filename, 2) >= 0); +#ifdef CYGWIN + /* euidaccess may have returned failure because Cygwin couldn't + determine the file's UID or GID; if so, we return success. */ + if (!res) + { + struct stat st; + if (stat (filename, &st) < 0) + return 0; + res = (st.st_uid == -1 || st.st_gid == -1); + } +#endif /* CYGWIN */ + return res; +#else /* not HAVE_EUIDACCESS */ /* Access isn't quite right because it uses the real uid and we really want to test with the effective uid. But Unix doesn't give us a right way to do it. Opening with O_WRONLY could work for an ordinary file, but would lose for directories. */ return (access (filename, 2) >= 0); -#endif +#endif /* not HAVE_EUIDACCESS */ #endif /* not MSDOS */ }