Now on revision 106716. ------------------------------------------------------------ revno: 106716 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2011-12-22 05:56:49 +0200 message: doc/emacs/building.texi (Debugger Operation): Fix a typo in "@end iftex". diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-12-21 08:39:32 +0000 +++ doc/emacs/ChangeLog 2011-12-22 03:56:49 +0000 @@ -1,3 +1,8 @@ +2011-12-22 Eli Zaretskii + + * building.texi (Debugger Operation): Fix a typo: "@end iftext" + should be @end iftex". + 2011-12-21 Chong Yidong * maintaining.texi (Advanced C-x v v): Use fileset terminology. === modified file 'doc/emacs/building.texi' --- doc/emacs/building.texi 2011-12-16 16:05:59 +0000 +++ doc/emacs/building.texi 2011-12-22 03:56:49 +0000 @@ -550,7 +550,7 @@ @kbd{M-x gud-gdb} and other commands listed in @iftex the preceding section. -@end iftext +@end iftex @ifnottex @ref{Starting GUD}. @end ifnottex ------------------------------------------------------------ revno: 106715 author: Drew Adams committer: Michael Albinus branch nick: trunk timestamp: Wed 2011-12-21 19:33:38 +0100 message: * files.el (file-remote-p): Fix docstring. (Bug#10319) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-21 12:20:40 +0000 +++ lisp/ChangeLog 2011-12-21 18:33:38 +0000 @@ -1,3 +1,7 @@ +2011-12-21 Drew Adams + + * files.el (file-remote-p): Fix docstring. (Bug#10319) + 2011-12-21 Jérémy Compostella * battery.el (battery-linux-sysfs): Add missing parameters from acpi. === modified file 'lisp/files.el' --- lisp/files.el 2011-12-04 08:02:42 +0000 +++ lisp/files.el 2011-12-21 18:33:38 +0000 @@ -917,24 +917,41 @@ (defun file-remote-p (file &optional identification connected) "Test whether FILE specifies a location on a remote system. -Returns nil or a string identifying the remote connection (ideally -a prefix of FILE). For example, the remote identification for filename -\"/user@host:/foo\" could be \"/user@host:\". -A file is considered \"remote\" if accessing it is likely to be slower or -less reliable than accessing local files. -Furthermore, relative file names do not work across remote connections. - -IDENTIFICATION specifies which part of the identification shall -be returned as string. IDENTIFICATION can be the symbol -`method', `user', `host' or `localname'; any other value is -handled like nil and means to return the complete identification -string. - -If CONNECTED is non-nil, the function returns an identification only -if FILE is located on a remote system, and a connection is established -to that remote system. - -`file-remote-p' will never open a connection on its own." +A file is considered remote if accessing it is likely to +be slower or less reliable than accessing local files. + +`file-remote-p' never opens a new remote connection. It can +only reuse a connection that is already open. + +Return nil or a string identifying the remote connection +\(ideally a prefix of FILE). Return nil if FILE is a relative +file name. + +When IDENTIFICATION is nil, the returned string is a complete +remote identifier: with components method, user, and host. The +components are those present in FILE, with defaults filled in for +any that are missing. + +IDENTIFICATION can specify which part of the identification to +return. IDENTIFICATION can be the symbol `method', `user', +`host', or `localname'. Any other value is handled like nil and +means to return the complete identification. The string returned +for IDENTIFICATION `localname' can differ depending on whether +there is an existing connection. + +If CONNECTED is non-nil, return an identification only if FILE is +located on a remote system and a connection is established to +that remote system. + +Tip: You can use this expansion of remote identifier components + to derive a new remote file name from an existing one. For + example, if FILE is \"/sudo::/path/to/file\" then + + \(concat \(file-remote-p FILE) \"/bin/sh\") + + returns a remote file name for file \"/bin/sh\" that has the + same remote identifier as FILE but expanded; a name such as + \"/sudo:root@myhost:/bin/sh\"." (let ((handler (find-file-name-handler file 'file-remote-p))) (if handler (funcall handler 'file-remote-p file identification connected) ------------------------------------------------------------ revno: 106714 committer: Bastien Guerry branch nick: trunk timestamp: Wed 2011-12-21 15:02:38 +0100 message: text.texi: add a section about Org Mode. This section describes general concepts behind Org Mode and redirects to the Org Manual when necessary. diff: === modified file 'doc/emacs/text.texi' --- doc/emacs/text.texi 2011-12-04 16:19:57 +0000 +++ doc/emacs/text.texi 2011-12-21 14:02:38 +0000 @@ -21,7 +21,10 @@ the file contains ordinary text, use Text mode, which customizes Emacs in small ways for the syntactic conventions of text. Outline mode provides special commands for operating on text with an outline -structure. +structure. Org mode extends Outline mode and turn Emacs into a +full-fledged organizer: you can manage TODO lists, store notes and +publish them in many formats. + @iftex @xref{Outline Mode}. @end iftex @@ -70,6 +73,7 @@ * Case:: Changing the case of text. * Text Mode:: The major modes for editing text files. * Outline Mode:: Editing outlines. +* Org Mode:: The Emacs organizer. * TeX Mode:: Editing input to the formatter TeX. * HTML Mode:: Editing HTML and SGML files. * Nroff Mode:: Editing input to the formatter nroff. @@ -1250,6 +1254,143 @@ (eval-after-load "outline" '(require 'foldout)) @end example +@node Org Mode +@section Org Mode +@kindex TAB @r{(Org Mode)} +@kindex S-TAB @r{(Org Mode)} +@cindex organizer +@cindex planner +@findex org-mode +@cindex fold +@cindex headline +@kindex M- @r{(Org Mode)} +@kindex M- @r{(Org Mode)} +@kindex M- @r{(Org Mode)} +@kindex M- @r{(Org Mode)} +@kindex S-M- @r{(Org Mode)} +@kindex S-M- @r{(Org Mode)} +@kindex S-M- @r{(Org Mode)} +@kindex S-M- @r{(Org Mode)} + +Org mode extends Outline mode to turn Emacs into an organizer and an +authoring system. + +When editing a file ending with the @file{.org} extension, Emacs +automatically uses @code{org-mode} as the major mode. In this mode, +headlines start with one (or more) leading star(s) and comments start +with the @code{#} character at the beginning of a line. + +@example +* This is the first headline +** This is a first sub-headline +* This is the second headline + +Some content here. + +# Some comment here. +@end example + +From here, you can use Org mode as a simple outliner: @key{TAB} on a +headline will cycle through the various folding states of a subtree, +and @key{S-TAB} anywhere in the buffer will (un)fold the whole +structure. + +You can also manipulate the structure of your document by moving a +headline up and down with @key{M-} and @key{M-}, or by +promoting and demoting a headline with @key{M-} and +@key{M-}. If you want to act on the whole subtree (i.e. the +headline and its content, including other headlines), simply add the +@kbd{Shift} key and use @key{S-M-}, @key{S-M-}, +@key{S-M-} and @key{S-M-}. + +For further details, see @ref{Document Structure,,,org, The Org Manual}. + +@menu +* Org as an organizer:: Manage TODO lists and agendas +* Org as an authoring system:: Export to various formats +@end menu + +@node Org as an organizer +@subsection Org as an organizer + +@cindex TODO keywords +@kindex C-c C-t @r{(Org Mode)} +@kindex C-c C-s @r{(Org Mode)} +@kindex C-c C-d @r{(Org Mode)} +@vindex org-todo-keywords +@findex org-todo +@findex org-agenda +@cindex scheduled +@cindex deadline +@cindex agenda + +Each headline can be turned into a TODO item calling @code{org-todo} +with @key{C-c C-t} anywhere on it. This will add the TODO keyword +@code{TODO}. Hit @key{C-c C-t} to cycle through the list of available +TODO keywords: you can configure the variable @code{org-todo-keywords} +to use your own list of keywords. + +Now that you have something to do, let's add a date to it: pressing +@key{C-c C-s} on a headline will add @code{SCHEDULED} below it, and +you will be prompted for a date through the calendar. @key{C-c C-d} +has the same effect, except that the item will have a @code{DEADLINE} +instead. + +Now that some TODO items are planned in the current file, add it to +the list of agenda files with @key{C-c [}. Calling the interactive +command @code{org-agenda} will prompt you for what you want to see: a +list of things to do this week, a list of TODO items with specific +keywords, etc. + +For further details, see @ref{TODO items,,,org, The Org Manual} and +@ref{Dates and times,,,org, The Org Manual}. + +@node Org as an authoring system +@subsection Org as an authoring system +@cindex export +@findex org-export +@cindex publish +@cindex code block +@cindex quote + +You may want to format your Org notes nicely and to prepare them for +export and publication. Org supports simple text formatting: + +@example +- This text is /emphasized/ +- This item uses *a bold font* +- This text is _underlined_ +- This text uses =a teletype font= +@end example + +If a paragraph is a quote or an example, you can use specific +environments: + +@example +#+begin_quote +``This is a quote.'' +#+end_quote + +#+begin_example +This is an example. +#+end_example +@end example + +These environments will be displayed in a specific way with respect +to the selected export/publish backend. + +To export the current buffer, press the @key{C-c C-e} key anywhere in +an Org buffer. Supported export formats include @code{HTML}, La@TeX{} +and @file{.odt} (OpenDocument format.) Depending on your system +installation, you can also directly export to @code{pdf}. + +To export several files at once to a specific directory either locally +or on the Internet, you will need to define a list of projects through +the variable @code{org-publish-project-alist}. + +For further details, see @ref{Exporting,,,org, The Org Manual} and +@ref{Publishing,,,org, The Org Manual}. + @node TeX Mode @section @TeX{} Mode @cindex @TeX{} mode ------------------------------------------------------------ revno: 106713 author: Jérémy Compostella committer: Stefan Monnier branch nick: trunk timestamp: Wed 2011-12-21 07:20:40 -0500 message: * lisp/battery.el (battery-linux-sysfs): Add missing parameters from acpi. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-21 11:30:00 +0000 +++ lisp/ChangeLog 2011-12-21 12:20:40 +0000 @@ -1,3 +1,7 @@ +2011-12-21 Jérémy Compostella + + * battery.el (battery-linux-sysfs): Add missing parameters from acpi. + 2011-12-21 Teodor Zlatanov * progmodes/cfengine.el: Add Version. === modified file 'lisp/battery.el' --- lisp/battery.el 2011-10-19 12:54:24 +0000 +++ lisp/battery.el 2011-12-21 12:20:40 +0000 @@ -421,10 +421,15 @@ The following %-sequences are provided: %c Current capacity (mAh or mWh) +%r Current rate %B Battery status (verbose) +%d Temperature (in degrees Celsius) %p Battery load percentage -%L AC line status (verbose)" - (let (charging-state +%L AC line status (verbose) +%m Remaining time (to charge or discharge) in minutes +%h Remaining time (to charge or discharge) in hours +%t Remaining time (to charge or discharge) in the form `h:min'" + (let (charging-state rate temperature hours (charge-full 0.0) (charge-now 0.0) (energy-full 0.0) @@ -444,6 +449,12 @@ (and (re-search-forward "POWER_SUPPLY_STATUS=\\(.*\\)$" nil t) (member charging-state '("Unknown" "Full" nil)) (setq charging-state (match-string 1))) + (when (re-search-forward + "POWER_SUPPLY_\\(CURRENT\\|POWER\\)_NOW=\\([0-9]*\\)$" + nil t) + (setq rate (float (string-to-number (match-string 2))))) + (when (re-search-forward "POWER_SUPPLY_TEMP=\\([0-9]*\\)$" nil t) + (setq temperature (match-string 1))) (let (full-string now-string) ;; Sysfs may list either charge (mAh) or energy (mWh). ;; Keep track of both, and choose which to report later. @@ -466,12 +477,30 @@ (setq energy-full (+ energy-full (string-to-number full-string)) energy-now (+ energy-now - (string-to-number now-string))))))))) + (string-to-number now-string)))))) + (goto-char (point-min)) + (when (and energy-now rate (not (zerop rate)) + (re-search-forward + "POWER_SUPPLY_VOLTAGE_NOW=\\([0-9]*\\)$" nil t)) + (let ((remaining (if (string= charging-state "Discharging") + energy-now + (- energy-full energy-now)))) + (setq hours (/ (/ (* remaining (string-to-number + (match-string 1))) + rate) + 10000000.0))))))) (list (cons ?c (cond ((or (> charge-full 0) (> charge-now 0)) (number-to-string charge-now)) ((or (> energy-full 0) (> energy-now 0)) (number-to-string energy-now)) (t "N/A"))) + (cons ?r (if rate (format "%.1f" (/ rate 1000000.0)) "N/A")) + (cons ?m (if hours (format "%d" (* hours 60)) "N/A")) + (cons ?h (if hours (format "%d" hours) "N/A")) + (cons ?t (if hours + (format "%d:%02d" hours (* (- hours (floor hours)) 60)) + "N/A")) + (cons ?d (or temperature "N/A")) (cons ?B (or charging-state "N/A")) (cons ?p (cond ((> charge-full 0) (format "%.1f" ------------------------------------------------------------ revno: 106712 committer: Ted Zlatanov branch nick: quickfixes timestamp: Wed 2011-12-21 06:30:00 -0500 message: * progmodes/cfengine.el: Add CFEngine 3.x syntax highlighting and support. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-21 07:46:49 +0000 +++ lisp/ChangeLog 2011-12-21 11:30:00 +0000 @@ -1,3 +1,16 @@ +2011-12-21 Teodor Zlatanov + + * progmodes/cfengine.el: Add Version. + + Add CFEngine 3.x syntax highlighting and support with + `cfengine3-mode', and rename the old `cfengine-mode' to + `cfengine2-mode'. Make `cfengine-mode' an automatic content-based + switcher between `cfengine3-mode' and `cfengine2-mode' by aliasing + it to `cfengine-auto-mode'. Rename variables specific to + `cfengine2-mode' from cfengine-* to cfengine2-*. Change the + modeline indicator to "CFE2" and "CFE3" depending on the mode, to + save space. Mark `cfengine-mode-abbrevs' as obsolete. + 2011-12-21 Chong Yidong * vc/vc-bzr.el (vc-bzr-rename-file): Don't pass ~ to Bzr in === modified file 'lisp/progmodes/cfengine.el' --- lisp/progmodes/cfengine.el 2011-11-20 03:48:53 +0000 +++ lisp/progmodes/cfengine.el 2011-12-21 11:30:00 +0000 @@ -5,6 +5,7 @@ ;; Author: Dave Love ;; Maintainer: Ted Zlatanov ;; Keywords: languages +;; Version: 1.1 ;; This file is part of GNU Emacs. @@ -29,18 +30,18 @@ ;; The CFEngine 3.x support doesn't have Imenu support but patches are ;; welcome. -;; You can set it up so either cfengine-mode (2.x and earlier) or -;; cfengine3-mode (3.x) will be picked, depending on the buffer +;; You can set it up so either `cfengine2-mode' (2.x and earlier) or +;; `cfengine3-mode' (3.x) will be picked, depending on the buffer ;; contents: -;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-auto-mode)) +;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-mode)) ;; OR you can choose to always use a specific version, if you prefer -;; it +;; it: ;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine3-mode)) -;; (add-to-list 'auto-mode-alist '("^cf\\." . cfengine-mode)) -;; (add-to-list 'auto-mode-alist '("^cfagent.conf\\'" . cfengine-mode)) +;; (add-to-list 'auto-mode-alist '("^cf\\." . cfengine2-mode)) +;; (add-to-list 'auto-mode-alist '("^cfagent.conf\\'" . cfengine2-mode)) ;; This is not the same as the mode written by Rolf Ebert ;; , distributed with cfengine-2.0.5. It does @@ -49,31 +50,36 @@ ;;; Code: (defgroup cfengine () - "Editing Cfengine files." + "Editing CFEngine files." :group 'languages) (defcustom cfengine-indent 2 - "*Size of a Cfengine indentation step in columns." + "*Size of a CFEngine indentation step in columns." :group 'cfengine :type 'integer) +(defvar cfengine-mode-debug nil + "Whether `cfengine-mode' should print debugging info.") + (defcustom cfengine-mode-abbrevs nil - "Abbrevs for Cfengine mode." + "Abbrevs for CFEngine2 mode." :group 'cfengine :type '(repeat (list (string :tag "Name") (string :tag "Expansion") (choice :tag "Hook" (const nil) function)))) +(make-obsolete-variable 'cfengine-mode-abbrevs 'edit-abbrevs "24.1") + ;; Taken from the doc for pre-release 2.1. (eval-and-compile - (defconst cfengine-actions + (defconst cfengine2-actions '("acl" "alerts" "binservers" "broadcast" "control" "classes" "copy" "defaultroute" "disks" "directories" "disable" "editfiles" "files" "filters" "groups" "homeservers" "ignore" "import" "interfaces" "links" "mailserver" "methods" "miscmounts" "mountables" "processes" "packages" "rename" "required" "resolve" "shellcommands" "tidy" "unmount" - ;; cfservd + ;; Keywords for cfservd. "admit" "grant" "deny") "List of the action keywords supported by Cfengine. This includes those for cfservd as well as cfagent.") @@ -98,11 +104,11 @@ '(string int real slist ilist rlist irange rrange counter)) "List of the CFEngine 3.x variable types.")) -(defvar cfengine-font-lock-keywords +(defvar cfengine2-font-lock-keywords `(;; Actions. ;; List the allowed actions explicitly, so that errors are more obvious. (,(concat "^[ \t]*" (eval-when-compile - (regexp-opt cfengine-actions t)) + (regexp-opt cfengine2-actions t)) ":") 1 font-lock-keyword-face) ;; Classes. @@ -117,46 +123,54 @@ (defvar cfengine3-font-lock-keywords `( + ;; Defuns. This happens early so they don't get caught by looser + ;; patterns. + (,(concat "\\<" cfengine3-defuns-regex "\\>" + "[ \t]+\\<\\([[:alnum:]_]+\\)\\>" + "[ \t]+\\<\\([[:alnum:]_]+\\)" + ;; Optional parentheses with variable names inside. + "\\(?:(\\([^)]*\\))\\)?") + (1 font-lock-builtin-face) + (2 font-lock-constant-face) + (3 font-lock-function-name-face) + (4 font-lock-variable-name-face nil t)) + + ;; Class selectors. (,(concat "^[ \t]*" cfengine3-class-selector-regex) 1 font-lock-keyword-face) + + ;; Categories. (,(concat "^[ \t]*" cfengine3-category-regex) 1 font-lock-builtin-face) + ;; Variables, including scope, e.g. module.var ("[@$](\\([[:alnum:]_.]+\\))" 1 font-lock-variable-name-face) ("[@$]{\\([[:alnum:]_.]+\\)}" 1 font-lock-variable-name-face) + ;; Variable definitions. ("\\<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1 font-lock-variable-name-face) - ;; CFEngine 3.x faces - ;; defuns - (,(concat "\\<" cfengine3-defuns-regex "\\>" - "[ \t]+\\<\\([[:alnum:]_]+\\)\\>" - "[ \t]+\\<\\([[:alnum:]_]+\\)\\((\\([^)]*\\))\\)?") - (1 font-lock-builtin-face) - (2 font-lock-constant-name-face) - (3 font-lock-function-name-face) - (5 font-lock-variable-name-face)) - ;; variable types + ;; Variable types. (,(concat "\\<" (eval-when-compile (regexp-opt cfengine3-vartypes t)) "\\>") 1 font-lock-type-face))) -(defvar cfengine-imenu-expression +(defvar cfengine2-imenu-expression `((nil ,(concat "^[ \t]*" (eval-when-compile - (regexp-opt cfengine-actions t)) + (regexp-opt cfengine2-actions t)) ":[^:]") 1) ("Variables/classes" "\\<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1) ("Variables/classes" "\\[ \t]+\\([[:alnum:]_]+\\)" 1)) - "`imenu-generic-expression' for Cfengine mode.") + "`imenu-generic-expression' for CFEngine mode.") -(defun cfengine-outline-level () - "`outline-level' function for Cfengine mode." +(defun cfengine2-outline-level () + "`outline-level' function for CFEngine mode." (if (looking-at "[^:]+\\(?:[:]+\\)$") (length (match-string 1)))) -(defun cfengine-beginning-of-defun () - "`beginning-of-defun' function for Cfengine mode. +(defun cfengine2-beginning-of-defun () + "`beginning-of-defun' function for CFEngine mode. Treats actions as defuns." (unless (<= (current-column) (current-indentation)) (end-of-line)) @@ -165,8 +179,8 @@ (goto-char (point-min))) t) -(defun cfengine-end-of-defun () - "`end-of-defun' function for Cfengine mode. +(defun cfengine2-end-of-defun () + "`end-of-defun' function for CFEngine mode. Treats actions as defuns." (end-of-line) (if (re-search-forward "^[[:alpha:]]+: *$" nil t) @@ -176,7 +190,7 @@ ;; Fixme: Should get an extra indent step in editfiles BeginGroup...s. -(defun cfengine-indent-line () +(defun cfengine2-indent-line () "Indent a line in Cfengine mode. Intended as the value of `indent-line-function'." (let ((pos (- (point-max) (point)))) @@ -283,15 +297,17 @@ (narrow-to-defun) (back-to-indentation) (setq parse (parse-partial-sexp (point-min) (point))) - (message "%S" parse) + (when cfengine-mode-debug + (message "%S" parse)) + (cond - ;; body/bundle blocks start at 0 + ;; Body/bundle blocks start at 0. ((looking-at (concat cfengine3-defuns-regex "\\>")) (indent-line-to 0)) - ;; categories are indented one step + ;; Categories are indented one step. ((looking-at (concat cfengine3-category-regex "[ \t]*$")) (indent-line-to cfengine-indent)) - ;; class selectors are indented two steps + ;; Class selectors are indented two steps. ((looking-at (concat cfengine3-class-selector-regex "[ \t]*$")) (indent-line-to (* 2 cfengine-indent))) ;; Outdent leading close brackets one step. @@ -303,11 +319,17 @@ (backward-sexp) (current-column))) (error nil))) - ;; inside a string and it starts before this line + ;; Inside a string and it starts before this line. ((and (nth 3 parse) (< (nth 8 parse) (save-excursion (beginning-of-line) (point)))) (indent-line-to 0)) - ;; inside a defun, but not a nested list (depth is 1) + + ;; Inside a defun, but not a nested list (depth is 1). This is + ;; a promise, usually. + + ;; Indent to cfengine-indent times the nested depth + ;; plus 2. That way, promises indent deeper than class + ;; selectors, which in turn are one deeper than categories. ((= 1 (nth 0 parse)) (indent-line-to (* (+ 2 (nth 0 parse)) cfengine-indent))) ;; Inside brackets/parens: indent to start column of non-comment @@ -411,18 +433,18 @@ (set (make-local-variable 'parse-sexp-ignore-comments) t)) (defun cfengine-common-syntax (table) - ;; the syntax defaults seem OK to give reasonable word movement + ;; The syntax defaults seem OK to give reasonable word movement. (modify-syntax-entry ?# "<" table) (modify-syntax-entry ?\n ">#" table) (modify-syntax-entry ?\" "\"" table) - ;; variable substitution: + ;; Variable substitution. (modify-syntax-entry ?$ "." table) - ;; Doze path separators: + ;; Doze path separators. (modify-syntax-entry ?\\ "." table)) ;;;###autoload -(define-derived-mode cfengine3-mode prog-mode "CFEngine3" - "Major mode for editing cfengine input. +(define-derived-mode cfengine3-mode prog-mode "CFE3" + "Major mode for editing CFEngine3 input. There are no special keybindings by default. Action blocks are treated as defuns, i.e. \\[beginning-of-defun] moves @@ -434,46 +456,46 @@ (setq font-lock-defaults '(cfengine3-font-lock-keywords nil nil nil beginning-of-defun)) - ;; use defuns as the essential syntax block + ;; Use defuns as the essential syntax block. (set (make-local-variable 'beginning-of-defun-function) #'cfengine3-beginning-of-defun) (set (make-local-variable 'end-of-defun-function) #'cfengine3-end-of-defun)) ;;;###autoload -(define-derived-mode cfengine-mode prog-mode "Cfengine" - "Major mode for editing cfengine input. +(define-derived-mode cfengine2-mode prog-mode "CFE2" + "Major mode for editing CFEngine2 input. There are no special keybindings by default. Action blocks are treated as defuns, i.e. \\[beginning-of-defun] moves to the action header." (cfengine-common-settings) - (cfengine-common-syntax cfengine-mode-syntax-table) + (cfengine-common-syntax cfengine2-mode-syntax-table) ;; Shell commands can be quoted by single, double or back quotes. ;; It's debatable whether we should define string syntax, but it ;; should avoid potential confusion in some cases. - (modify-syntax-entry ?\' "\"" cfengine-mode-syntax-table) - (modify-syntax-entry ?\` "\"" cfengine-mode-syntax-table) + (modify-syntax-entry ?\' "\"" cfengine2-mode-syntax-table) + (modify-syntax-entry ?\` "\"" cfengine2-mode-syntax-table) - (set (make-local-variable 'indent-line-function) #'cfengine-indent-line) + (set (make-local-variable 'indent-line-function) #'cfengine2-indent-line) (set (make-local-variable 'outline-regexp) "[ \t]*\\(\\sw\\|\\s_\\)+:+") - (set (make-local-variable 'outline-level) #'cfengine-outline-level) + (set (make-local-variable 'outline-level) #'cfengine2-outline-level) (set (make-local-variable 'fill-paragraph-function) #'cfengine-fill-paragraph) - (define-abbrev-table 'cfengine-mode-abbrev-table cfengine-mode-abbrevs) + (define-abbrev-table 'cfengine2-mode-abbrev-table cfengine-mode-abbrevs) (setq font-lock-defaults - '(cfengine-font-lock-keywords nil nil nil beginning-of-line)) + '(cfengine2-font-lock-keywords nil nil nil beginning-of-line)) ;; Fixme: set the args of functions in evaluated classes to string ;; syntax, and then obey syntax properties. - (setq imenu-generic-expression cfengine-imenu-expression) + (setq imenu-generic-expression cfengine2-imenu-expression) (set (make-local-variable 'beginning-of-defun-function) - #'cfengine-beginning-of-defun) - (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun)) + #'cfengine2-beginning-of-defun) + (set (make-local-variable 'end-of-defun-function) #'cfengine2-end-of-defun)) ;;;###autoload (defun cfengine-auto-mode () - "Choose between `cfengine-mode' and `cfengine3-mode' depending + "Choose between `cfengine2-mode' and `cfengine3-mode' depending on the buffer contents" (let ((v3 nil)) (save-restriction @@ -481,7 +503,9 @@ (while (not (or (eobp) v3)) (setq v3 (looking-at (concat cfengine3-defuns-regex "\\>"))) (forward-line))) - (if v3 (cfengine3-mode) (cfengine-mode)))) + (if v3 (cfengine3-mode) (cfengine2-mode)))) + +(defalias 'cfengine-mode 'cfengine-auto-mode) (provide 'cfengine3) (provide 'cfengine) ------------------------------------------------------------ revno: 106711 committer: Paul Eggert branch nick: trunk timestamp: Wed 2011-12-21 01:58:39 -0800 message: Spelling fixes. diff: === modified file 'doc/misc/auth.texi' --- doc/misc/auth.texi 2011-11-09 06:10:51 +0000 +++ doc/misc/auth.texi 2011-12-21 09:58:39 +0000 @@ -281,7 +281,7 @@ Note that the password needs to be evaluated if it's a function. It's wrapped in a function to provide some security. -Later, after a successful login, @code{nnimal.el} calls the +Later, after a successful login, @code{nnimap.el} calls the @code{:save-function} like so: @example === modified file 'lisp/ChangeLog.12' --- lisp/ChangeLog.12 2011-12-19 06:21:24 +0000 +++ lisp/ChangeLog.12 2011-12-21 09:58:39 +0000 @@ -27413,7 +27413,7 @@ which has been added in Emacs 21.1. (c-mode, c++-mode, objc-mode, java-mode, idl-mode, pike-mode) (awk-mode): Use it. - (make-local-hook): Suppress warning about obsoleteness. + (make-local-hook): Suppress warning about obsolescence. * progmodes/cc-engine.el, cc-align.el, cc-cmds.el (c-append-backslashes-forward, c-delete-backslashes-forward) === modified file 'lisp/calc/calc-alg.el' --- lisp/calc/calc-alg.el 2011-05-23 17:57:17 +0000 +++ lisp/calc/calc-alg.el 2011-12-21 09:58:39 +0000 @@ -1841,7 +1841,7 @@ expr)))) ;;; Simplify a polynomial in list form by stripping off high-end zeros. -;;; This always leaves the constant part, i.e., nil->nil and nonnil->nonnil. +;;; This always leaves the constant part, i.e., nil->nil and non-nil->non-nil. (defun math-poly-simplify (p) (and p (if (Math-zerop (nth (1- (length p)) p)) === modified file 'lisp/calendar/holidays.el' --- lisp/calendar/holidays.el 2011-10-04 17:26:55 +0000 +++ lisp/calendar/holidays.el 2011-12-21 09:58:39 +0000 @@ -723,7 +723,7 @@ (let ((m displayed-month) (y displayed-year)) (calendar-increment-month m y (- 11 month)) - (if (> m 9) ; is november visible? + (if (> m 9) ; Is November visible? (list (list (list month day y) string))))) (defun holiday-float (month dayname n string &optional day) === modified file 'lisp/gnus/nndiary.el' --- lisp/gnus/nndiary.el 2011-12-04 08:02:42 +0000 +++ lisp/gnus/nndiary.el 2011-12-21 09:58:39 +0000 @@ -1161,7 +1161,7 @@ (defun nndiary-parse-schedule-value (str min-or-values max) ;; Parse the schedule string STR, or signal an error. - ;; Signals are caught by `nndary-schedule'. + ;; Signals are caught by `nndiary-schedule'. (if (string-match "[ \t]*\\*[ \t]*" str) ;; unspecified nil @@ -1204,7 +1204,7 @@ ;; - Returns nil if `*' ;; - Otherwise returns a list of integers and/or ranges (BEG . END) ;; The exception is the Timze-Zone value which is always of the form (STR). - ;; Signals are caught by `nndary-schedule'. + ;; Signals are caught by `nndiary-schedule'. (let ((header (format "^X-Diary-%s: \\(.*\\)$" head))) (goto-char (point-min)) (if (not (re-search-forward header nil t)) === modified file 'lisp/international/robin.el' --- lisp/international/robin.el 2011-11-13 07:48:23 +0000 +++ lisp/international/robin.el 2011-12-21 09:58:39 +0000 @@ -50,9 +50,9 @@ ;; identified by a string called package name. Use robin-define-package ;; to define a robin package. -;; (robin-define-package NAME DOCTSTRING -;; (INPUT1 OUPUT1) -;; (INPUT2 OUPUT2) +;; (robin-define-package NAME DOCSTRING +;; (INPUT1 OUTPUT1) +;; (INPUT2 OUTPUT2) ;; ...) ;; NAME is a string identifying the robin package. It often starts with a === modified file 'lisp/net/ntlm.el' --- lisp/net/ntlm.el 2011-11-20 19:35:27 +0000 +++ lisp/net/ntlm.el 2011-12-21 09:58:39 +0000 @@ -440,7 +440,7 @@ (defun ntlm-smb-dohash (in key forw) "Return the hash value for a string IN and a string KEY. -Length of IN and KEY are 64. FORW non nill means forward, nil means +Length of IN and KEY are 64. FORW non-nil means forward, nil means backward." (let (pk1 ;string of length 56 c ;string of length 28 === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2011-12-05 08:55:25 +0000 +++ lisp/net/tramp.el 2011-12-21 09:58:39 +0000 @@ -3506,7 +3506,7 @@ (cond ((char-equal other-write ?w) (tramp-compat-octal-to-decimal "00002")) ((char-equal other-write ?-) 0) - (t (error "Nineth char `%c' must be one of `w-'" other-write))) + (t (error "Ninth char `%c' must be one of `w-'" other-write))) (cond ((char-equal other-execute-or-sticky ?x) (tramp-compat-octal-to-decimal "00001")) === modified file 'lisp/progmodes/ada-stmt.el' --- lisp/progmodes/ada-stmt.el 2011-01-26 08:36:39 +0000 +++ lisp/progmodes/ada-stmt.el 2011-12-21 09:58:39 +0000 @@ -56,7 +56,7 @@ ;; BUGS: ;;;> I have the following suggestions for the function template: 1) I ;;;> don't want it automatically assigning it a name for the return variable. I -;;;> never want it to be called "Result" because that is nondescriptive. If you +;;;> never want it to be called "Result" because that is nondescript. If you ;;;> must define a variable, give me the ability to specify its name. ;;;> ;;;> 2) You do not provide a type for variable 'Result'. Its type is the same === modified file 'lisp/term.el' --- lisp/term.el 2011-11-27 04:43:11 +0000 +++ lisp/term.el 2011-12-21 09:58:39 +0000 @@ -37,8 +37,8 @@ ;; -------------------------------------- ;; ;; While the message passing and the colorization surely introduce some -;; overhead this has became so small that IMHO is surely outweighted by -;; the benefits you get but, as usual, YMMV +;; overhead this has became so small that IMHO it is surely outweighed by +;; the benefits you get but, as usual, YMMV. ;; ;; Important caveat, when deciding the cursor/'gray keys' keycodes I had to ;; make a choice: on my Linux box this choice allows me to run all the === modified file 'lisp/textmodes/remember.el' --- lisp/textmodes/remember.el 2011-11-14 23:59:56 +0000 +++ lisp/textmodes/remember.el 2011-12-21 09:58:39 +0000 @@ -474,7 +474,7 @@ (replace-match (let ((style (if (boundp 'calendar-date-style) calendar-date-style - ;; Don't complain about obsoleteness. + ;; Don't complain about obsolescence. (if (with-no-warnings european-calendar-style) 'european 'american)))) === modified file 'src/print.c' --- src/print.c 2011-11-19 09:18:31 +0000 +++ src/print.c 2011-12-21 09:58:39 +0000 @@ -620,7 +620,7 @@ printcharfun = Vprin1_to_string_buffer; PRINTPREPARE; print (object, printcharfun, NILP (noescape)); - /* Make Vprin1_to_string_buffer be the default buffer after PRINTFINSH */ + /* Make Vprin1_to_string_buffer be the default buffer after PRINTFINISH */ PRINTFINISH; } ------------------------------------------------------------ revno: 106710 committer: Chong Yidong branch nick: trunk timestamp: Wed 2011-12-21 16:39:32 +0800 message: More updates for VC documentation. * files.texi (Misc File Ops): Mention vc-rename-file. * maintaining.texi (Advanced C-x v v): Use fileset terminology. (VC With A Merging VCS, VC Change Log): Add xref to VC Pull node. (VC Pull): Mention vc-log-incoming. (Log Buffer): Add CVS/RCS only disclaimer. * vc1-xtra.texi (Remote Repositories): Update introduction. (Local Version Control): Node deleted (obsolete with DVCSes). (Remote Repositories, Version Backups): Node deleted. Move documentation of vc-cvs-stay-local to CVS Options. (CVS Options): Reduce verbosity of description of obscure CVS locking feature. (Making Revision Tags, Revision Tag Caveats): Merge into Revision Tags node. (Revision Tags): Move under Miscellaneous VC subsection. (Change Logs and VC): Note that this is wrong for DVCSs. De-document log entry manipulating features. (Renaming and VC): Describe how it works on modern VCSes. * programs.texi (Custom C Indent): Add index entries. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-12-20 16:00:47 +0000 +++ doc/emacs/ChangeLog 2011-12-21 08:39:32 +0000 @@ -1,3 +1,27 @@ +2011-12-21 Chong Yidong + + * maintaining.texi (Advanced C-x v v): Use fileset terminology. + (VC With A Merging VCS, VC Change Log): Add xref to VC Pull node. + (VC Pull): Mention vc-log-incoming. + (Log Buffer): Add CVS/RCS only disclaimer. + + * vc1-xtra.texi (Remote Repositories): Update introduction. + (Local Version Control): Node deleted (obsolete with DVCSes). + (Remote Repositories, Version Backups): Node deleted. Move + documentation of vc-cvs-stay-local to CVS Options. + (CVS Options): Reduce verbosity of description of obscure CVS + locking feature. + (Making Revision Tags, Revision Tag Caveats): Merge into Revision + Tags node. + (Revision Tags): Move under Miscellaneous VC subsection. + (Change Logs and VC): Note that this is wrong for DVCSs. + De-document log entry manipulating features. + (Renaming and VC): Describe how it works on modern VCSes. + + * files.texi (Misc File Ops): Mention vc-rename-file. + + * programs.texi (Custom C Indent): Add index entries. + 2011-12-20 Alan Mackenzie * programs.texi (Motion in C): Update the description of C-M-a and === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-12-20 03:00:10 +0000 +++ doc/emacs/emacs.texi 2011-12-21 08:39:32 +0000 @@ -747,7 +747,6 @@ * VC Undo:: Canceling changes before or after committing. * VC Directory Mode:: Listing files managed by version control. * Branches:: Multiple lines of development. -* Remote Repositories:: Efficient access to remote CVS servers. * Revision Tags:: Symbolic names for revisions. * Miscellaneous VC:: Various other commands and features of VC. * Customizing VC:: Variables that change VC's behavior. @@ -780,21 +779,12 @@ * Merging:: Transferring changes between branches. * Creating Branches:: How to start a new branch. -Remote Repositories - -* Version Backups:: Keeping local copies of repository versions. -* Local Version Control:: Using another version system for local editing. - -Revision Tags - -* Making Revision Tags:: The tag facilities. -* Revision Tag Caveats:: Things to be careful of when using tags. - Miscellaneous Commands and Features of VC * Change Logs and VC:: Generating a change log file from log entries. * Renaming and VC:: A command to rename both the source and master file correctly. +* Revision Tags:: Symbolic names for revisions. * Version Headers:: Inserting version control headers into working files. Customizing VC === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2011-12-03 16:17:29 +0000 +++ doc/emacs/files.texi 2011-12-21 08:39:32 +0000 @@ -1498,6 +1498,7 @@ If @var{new} is not an existing directory, it copies all the contents of @var{old} into a new directory named @var{new}. +@cindex renaming files @findex rename-file @kbd{M-x rename-file} reads two file names @var{old} and @var{new} using the minibuffer, then renames file @var{old} as @var{new}. If @@ -1512,6 +1513,13 @@ applies to all the remaining commands in this section. All of them ask for confirmation when the new file name already exists, too. +@ifnottex + Note that if a file is under version control (@pxref{Version +Control}), you normally ought to rename it via the version control +system instead, using @kbd{M-x vc-rename-file}. @xref{Renaming and +VC}. +@end ifnottex + @findex add-name-to-file @cindex hard links (creation) @kbd{M-x add-name-to-file} adds an additional name to an existing === modified file 'doc/emacs/maintaining.texi' --- doc/emacs/maintaining.texi 2011-12-20 03:00:10 +0000 +++ doc/emacs/maintaining.texi 2011-12-21 08:39:32 +0000 @@ -56,8 +56,6 @@ * VC Directory Mode:: Listing files managed by version control. * Branches:: Multiple lines of development. @ifnottex -* Remote Repositories:: Efficient access to remote CVS servers. -* Revision Tags:: Symbolic names for revisions. * Miscellaneous VC:: Various other commands and features of VC. * Customizing VC:: Variables that change VC's behavior. @end ifnottex @@ -482,10 +480,11 @@ If committing to a shared repository, the commit may fail if the repository that has been changed since your last update. In that -case, you must perform an update before trying again. If using a -decentralized version control system, use @kbd{C-x v +} or @kbd{C-x v -m} (@pxref{Merging}). If using a centralized version control system, -type @kbd{C-x v v} again to merge in the repository changes. +case, you must perform an update before trying again. On a +decentralized version control system, use @kbd{C-x v +} (@pxref{VC +Pull}) or @kbd{C-x v m} (@pxref{Merging}). On a centralized version +control system, type @kbd{C-x v v} again to merge in the repository +changes. @item Finally, if you are using a centralized version control system, check @@ -557,31 +556,27 @@ @itemize @bullet @item -If the file is modified (or locked), you can specify the revision ID -to use for the new version that you commit. This is one way to create -a new branch (@pxref{Branches}). - -@item -If the file is not modified (and unlocked), you can specify the -revision to select; this lets you start working from an older -revision, or on another branch. If you do not enter any revision, -that takes you to the highest (``head'') revision on the current -branch; therefore @kbd{C-u C-x v v @key{RET}} is a convenient way to -get the latest version of a file from the repository. - -@item @cindex specific version control system -Instead of the revision ID, you can also specify the name of a -version control system. This is useful when one file is being managed -with two version control systems at the same time -@iftex -(@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs -Features}). -@end iftex -@ifnottex -(@pxref{Local Version Control}). -@end ifnottex - +You can specify the name of a version control system. This is useful +if the fileset can be managed by more than one version control system, +and Emacs fails to detect the correct one. + +@item +Otherwise, if using CVS or RCS, you can specify a revision ID. + +If the fileset is modified (or locked), this makes Emacs commit with +that revision ID. You can create a new branch by supplying an +appropriate revision ID (@pxref{Branches}). + +If the fileset is unmodified (and unlocked), this checks the specified +revision into the working tree. You can also specify a revision on +another branch by giving its revision or branch ID (@pxref{Switching +Branches}). An empty argument (i.e.@: @kbd{C-u C-x v v @key{RET}}) +checks out the latest (``head'') revision on the current branch. + +This signals an error on a decentralized version control system. +Those systems do not let you specify your own revision IDs, nor do +they use the concept of ``checking out'' individual files. @end itemize @node Log Buffer @@ -646,8 +641,9 @@ this command searches that item for entries matching the file(s) to be committed, and inserts them. @ifnottex -@xref{Change Logs and VC}, for the opposite way of -working---generating ChangeLog entries from the Log Edit buffer. +If you are using CVS or RCS, see @ref{Change Logs and VC}, for the +opposite way of working---generating ChangeLog entries from the Log +Edit buffer. @end ifnottex To abort a commit, just @strong{don't} type @kbd{C-c C-c} in that @@ -935,13 +931,13 @@ (@code{vc-log-incoming}) command displays a log buffer showing the changes that will be applied, the next time you run the version control system's ``pull'' command to get new revisions from another -repository. This other repository is the default one from which -changes are pulled, as defined by the version control system; with a -prefix argument, @code{vc-log-incoming} prompts for a specific -repository. Similarly, @kbd{C-x v O} (@code{vc-log-outgoing}) shows -the changes that will be sent to another repository, the next time you -run the ``push'' command; with a prefix argument, it prompts for a -specific destination repository. +repository (@pxref{VC Pull}). This other repository is the default +one from which changes are pulled, as defined by the version control +system; with a prefix argument, @code{vc-log-incoming} prompts for a +specific repository. Similarly, @kbd{C-x v O} +(@code{vc-log-outgoing}) shows the changes that will be sent to +another repository, the next time you run the ``push'' command; with a +prefix argument, it prompts for a specific destination repository. In the @samp{*vc-change-log*} buffer, you can use the following keys to move between the logs of revisions and of files, and to examine and @@ -1339,8 +1335,8 @@ Otherwise, it pulls from a default location determined by the version control system. - Amongst decentralized version control systems, @kbd{C-x v +} -currently supports only Bazaar, Git, and Mercurial. On Bazaar, it + Amongst decentralized version control systems, @kbd{C-x v +} is +currently supported only by Bazaar, Git, and Mercurial. On Bazaar, it calls @command{bzr pull} for ordinary branches (to pull from a master branch into a mirroring branch), and @command{bzr update} for a bound branch (to pull from a central repository). On Git, it calls @@ -1349,6 +1345,10 @@ -u} to fetch changesets from the default remote repository and update the working directory. + Prior to pulling, you can use @kbd{C-x v I} (@code{vc-log-incoming}) +to view a log buffer of the changes to be applied. @xref{VC Change +Log}. + On a centralized version control system like CVS, @kbd{C-x v +} updates the current VC fileset from the repository. === modified file 'doc/emacs/programs.texi' --- doc/emacs/programs.texi 2011-12-20 16:00:47 +0000 +++ doc/emacs/programs.texi 2011-12-21 08:39:32 +0000 @@ -606,12 +606,13 @@ including how to override parts of an existing style and how to define your own styles. - As an alternative to specifying a style, you can get Emacs to -@dfn{guess} the style by scanning a code buffer which is already -formatted. To do this, call @kbd{M-x c-guess} in your sample buffer. -You can then apply this guessed style to other buffers with @kbd{M-x +@findex c-guess +@findex c-guess-install + As an alternative to specifying a style, you can tell Emacs to guess +a style by typing @kbd{M-x c-guess} in a sample code buffer. You can +then apply the guessed style to other buffers with @kbd{M-x c-guess-install}. @xref{Guessing the Style,,, ccmode, the CC Mode -Manual}, for more details about this mechanism. +Manual}, for details. @node Parentheses @section Commands for Editing with Parentheses === modified file 'doc/emacs/vc1-xtra.texi' --- doc/emacs/vc1-xtra.texi 2011-12-20 03:00:10 +0000 +++ doc/emacs/vc1-xtra.texi 2011-12-21 08:39:32 +0000 @@ -5,229 +5,148 @@ @c This file is included either in vc-xtra.texi (when producing the @c printed version) or in the main Emacs manual (for the on-line version). -@node Remote Repositories -@subsection Remote Repositories -@cindex remote repositories - - A common way of using CVS and other more advanced VCSes is to set up -a central repository on some Internet host, then have each -developer check out a personal working copy of the files on his local -machine. Committing changes to the repository, and picking up changes -from other users into one's own working area, then works by direct -interactions with the repository server. - - One difficulty is that access to a repository server is often slow, -and that developers might need to work off-line as well. While only -third-generation decentralized VCses such as GNU Arch or Mercurial -really solve this problem, VC is designed to reduce the amount of -network interaction necessary. - - If you are using a truly decentralized VCS you can skip the rest of -this section. It describes backup and local-repository techniques -that are only useful for Subversion and earlier VCSes. +@node Miscellaneous VC +@subsection Miscellaneous Commands and Features of VC + + This section explains the less-frequently-used features of VC. @menu -* Version Backups:: Keeping local copies of repository versions. -* Local Version Control:: Using another version system for local editing. +* Change Logs and VC:: Generating a change log file from log entries. +* Renaming and VC:: A command to rename both the source and master + file correctly. +* Revision Tags:: Symbolic names for revisions. +* Version Headers:: Inserting version control headers into working files. @end menu -@node Version Backups -@subsubsection Version Backups -@cindex version backups - -@cindex automatic version backups - When VC sees that the repository for a file is on a remote -machine, it automatically makes local backups of unmodified versions -of the file---@dfn{automatic version backups}. This means that you -can compare the file to the repository version (@kbd{C-x v =}), or -revert to that version (@kbd{C-x v u}), without any network -interactions. - - The local copy of the unmodified file is called a @dfn{version -backup} to indicate that it corresponds exactly to a version that is -stored in the repository. Note that version backups are not the same -as ordinary Emacs backup files -@iftex -(@pxref{Backup,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Backup}). -@end ifnottex -But they follow a similar naming convention. - - For a file that comes from a remote repository, VC makes a -version backup whenever you save the first changes to the file, and -removes it after you have committed your modified version to the -repository. You can disable the making of automatic version backups by -setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}). - -@cindex manual version backups - The name of the automatic version backup for version @var{version} -of file @var{file} is @code{@var{file}.~@var{version}.~}. This is -almost the same as the name used by @kbd{C-x v ~} -@iftex -(@pxref{Old Revisions,,,emacs, the Emacs Manual}), -@end iftex -@ifnottex -(@pxref{Old Revisions}), -@end ifnottex -the only difference being the additional dot (@samp{.}) after the -version number. This similarity is intentional, because both kinds of -files store the same kind of information. The file made by @kbd{C-x v -~} acts as a @dfn{manual version backup}. - - All the VC commands that operate on old versions of a file can use -both kinds of version backups. For instance, @kbd{C-x v ~} uses -either an automatic or a manual version backup, if possible, to get -the contents of the version you request. Likewise, @kbd{C-x v =} and -@kbd{C-x v u} use either an automatic or a manual version backup, if -one of them exists, to get the contents of a version to compare or -revert to. If you changed a file outside of Emacs, so that no -automatic version backup was created for the previous text, you can -create a manual backup of that version using @kbd{C-x v ~}, and thus -obtain the benefit of the local copy for Emacs commands. - - The only difference in Emacs's handling of manual and automatic -version backups, once they exist, is that Emacs deletes automatic -version backups when you commit to the repository. By contrast, -manual version backups remain until you delete them. - -@node Local Version Control -@subsubsection Local Version Control -@cindex local version control -@cindex local back end (version control) - -When you make many changes to a file that comes from a remote -repository, it can be convenient to have version control on your local -machine as well. You can then record intermediate versions, revert to -a previous state, etc., before you actually commit your changes to the -remote server. - -VC lets you do this by putting a file under a second, local version -control system, so that the file is effectively registered in two -systems at the same time. For the description here, we will assume -that the remote system is CVS, and you use RCS locally, although the -mechanism works with any combination of version control systems -(@dfn{back ends}). - -To make it work with other back ends, you must make sure that the -``more local'' back end comes before the ``more remote'' back end in -the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By -default, this variable is set up so that you can use remote CVS and -local RCS as described here. - -To start using local RCS for a file that comes from a remote CVS -server, you must @emph{register the file in RCS}, by typing @kbd{C-u -C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a -prefix argument, and specify RCS as the back end.) - -You can do this at any time; it does not matter whether you have -already modified the file with respect to the version in the CVS -repository. If possible, VC tries to make the RCS master start with -the unmodified repository version, then checks in any local changes -as a new version. This works if you have not made any changes yet, or -if the unmodified repository version exists locally as a version -backup (@pxref{Version Backups}). If the unmodified version is not -available locally, the RCS master starts with the modified version; -the only drawback to this is that you cannot compare your changes -locally to what is stored in the repository. - -The version number of the RCS master is derived from the current CVS -version, starting a branch from it. For example, if the current CVS -version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in -the RCS master will be identical to version 1.23 under CVS; your first -changes are checked in as 1.23.1.1. (If the unmodified file is not -available locally, VC will check in the modified file twice, both as -1.23 and 1.23.1.1, to make the revision numbers consistent.) - -If you do not use locking under CVS (the default), locking is also -disabled for RCS, so that editing under RCS works exactly as under -CVS. - -When you are done with local editing, you can commit the final version -back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}. -This initializes the log entry buffer -@iftex -(@pxref{Log Buffer,,,emacs, the Emacs Manual}) -@end iftex -@ifnottex -(@pxref{Log Buffer}) -@end ifnottex -to contain all the log entries you have recorded in the RCS master; -you can edit them as you wish, and then commit in CVS by typing -@kbd{C-c C-c}. If the commit is successful, VC removes the RCS -master, so that the file is once again registered under CVS only. -(The RCS master is not actually deleted, just renamed by appending -@samp{~} to the name, so that you can refer to it later if you wish.) - -While using local RCS, you can pick up recent changes from the CVS -repository into your local file, or commit some of your changes back -to CVS, without terminating local RCS version control. To do this, -switch to the CVS back end temporarily, with the @kbd{C-x v b} command: - -@table @kbd -@item C-x v b -Switch to another back end that the current file is registered -under (@code{vc-switch-backend}). - -@item C-u C-x v b @var{backend} @key{RET} -Switch to @var{backend} for the current file. -@end table - -@kindex C-x v b -@findex vc-switch-backend -@kbd{C-x v b} does not change the buffer contents, or any files; it -only changes VC's perspective on how to handle the file. Any -subsequent VC commands for that file will operate on the back end that -is currently selected. - -If the current file is registered in more than one back end, typing -@kbd{C-x v b} ``cycles'' through all of these back ends. With a -prefix argument, it asks for the back end to use in the minibuffer. - -Thus, if you are using local RCS, and you want to pick up some recent -changes in the file from remote CVS, first visit the file, then type -@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m -@key{RET}} to merge the news -@iftex -(@pxref{Merging,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Merging}). -@end ifnottex -You can then switch back to RCS by typing @kbd{C-x v b} again, and -continue to edit locally. - -But if you do this, the revision numbers in the RCS master no longer -correspond to those of CVS. Technically, this is not a problem, but -it can become difficult to keep track of what is in the CVS repository -and what is not. So we suggest that you return from time to time to -CVS-only operation, by committing your local changes back to the -repository using @kbd{C-u C-x v v cvs @key{RET}}. +@node Change Logs and VC +@subsubsection Change Logs and VC + + If you use RCS or CVS for a program with a @file{ChangeLog} file +@iftex +(@pxref{Change Log,,,emacs, the Emacs Manual}), +@end iftex +@ifnottex +(@pxref{Change Log}), +@end ifnottex +you can generate change log entries from the version control log +entries of previous commits. + + Note that this only works with RCS or CVS. This procedure would be +particularly incorrect on a modern changeset-based version control +system, where changes to the @file{ChangeLog} file would normally be +committed as part of a changeset. In that case, you should write the +change log entries first, then pull them into the @samp{*vc-log*} +buffer when you commit +@iftex +(@pxref{Log Buffer,,,emacs, the Emacs Manual}). +@end iftex +@ifnottex +(@pxref{Log Buffer}). +@end ifnottex + +@table @kbd +@item C-x v a +@kindex C-x v a +@findex vc-update-change-log +Visit the current directory's @file{ChangeLog} file and, for +registered files in that directory, create new entries for versions +committed since the most recent change log entry +(@code{vc-update-change-log}). + +@item C-u C-x v a +As above, but only find entries for the current buffer's file. +@end table + + For example, suppose the first line of @file{ChangeLog} is dated +1999-04-10, and that the only check-in since then was by Nathaniel +Bowditch to @file{rcs2log} on 1999-05-22 with log entry @samp{Ignore +log messages that start with `#'.}. Then @kbd{C-x v a} inserts this +@file{ChangeLog} entry: + +@iftex +@medbreak +@end iftex +@smallexample +@group +1999-05-22 Nathaniel Bowditch + + * rcs2log: Ignore log messages that start with `#'. +@end group +@end smallexample +@iftex +@medbreak +@end iftex + +@noindent +If the version control log entry specifies a function name (in +parenthesis at the beginning of a line), that is reflected in the +@file{ChangeLog} entry. For example, if a log entry for @file{vc.el} +is @samp{(vc-do-command): Check call-process status.}, the +@file{ChangeLog} entry is: + +@iftex +@medbreak +@end iftex +@smallexample +@group +1999-05-06 Nathaniel Bowditch + + * vc.el (vc-do-command): Check call-process status. +@end group +@end smallexample +@iftex +@medbreak +@end iftex + + When @kbd{C-x v a} adds several change log entries at once, it +groups related log entries together if they all are checked in by the +same author at nearly the same time. If the log entries for several +such files all have the same text, it coalesces them into a single +entry. + +@node Renaming and VC +@subsubsection Renaming VC Work Files and Master Files +@cindex renaming version-controlled files + +@table @kbd +@item M-x vc-rename-file +Prompt for two file names, @var{VAR} and @var{OLD}, and rename them in +the version-controlled working tree. +@end table + +@findex vc-rename-file + If you wish to rename a registered file in a version-controlled +working tree, use the command @kbd{M-x vc-rename-file}. This prompts +for two arguments: the file you wish to rename, followed by the new +name; then it performs the renaming through the version control +system. + + On modern version control systems that have built-in support for +renaming, the renaming operation takes effect immediately in the +working tree, and takes effect in the repository when you commit the +renamed file. The renamed file retains the full change history of the +original file. + + On CVS and older version control systems, the @code{vc-rename-file} +command actually works by creating a copy of the old file under the +new name, registering it, and deleting the old file. In this case, +the change history is not preserved. @node Revision Tags -@subsection Revision Tags -@cindex tags and version control - - In a VCS with per-file revision numbers (such as SCCS, RCS, or CVS) -@dfn{tag} is a named set of file versions (one for each registered -file) that you can treat as a unit. In a VCS with per-repository -version numbers (Subversion and most later ones) a tag is simply -a symbolic name for a revision. - - One important kind of tag is a @dfn{release}, a (theoretically) -stable version of the system that is ready for distribution to users. - -@menu -* Making Revision Tags:: The tag facilities. -* Revision Tag Caveats:: Things to be careful of when using tags. -@end menu - -@node Making Revision Tags -@subsubsection Making and Using Revision Tags - - There are two basic commands for tags; one makes a -tag with a given name, the other retrieves a named tag. +@subsubsection Revision Tags +@cindex revision tag +@cindex tags for version control + + Most version control systems allow you to apply a @dfn{revision tag} +to a specific version of a version-controlled tree. On modern +changeset-based version control systems, a revision tag is simply a +symbolic name for a particular revision. On older file-based systems +like CVS, each tag is added to the entire set of version-controlled +files, allowing them to be handled as a unit. Revision tags are +commonly used to identify releases that are distributed to users. + + There are two basic commands for tags; one makes a tag with a given +name, the other retrieves a named tag. @table @code @kindex C-x v s @@ -241,20 +160,15 @@ @findex vc-retrieve-tag @item C-x v r @var{name} @key{RET} For all registered files at or below the current directory level, -retrieve the tagged revision @var{name}. This command will -switch to a branch if @var{name} is a branch name and your VCS -distinguishes branches from tags. -(@code{vc-retrieve-tag}). +retrieve the tagged revision @var{name}. This command will switch to a +branch if @var{name} is a branch name and your VCS distinguishes +branches from tags. (@code{vc-retrieve-tag}). This command reports an error if any files are locked at or below the current directory, without changing anything; this is to avoid overwriting work in progress. @end table -Tags are inexpensive, so you need not hesitate to create them whenever -they are useful. Branches vary in cost depending on your VCS; in -older ones they may be expensive. - You can give a tag or branch name as an argument to @kbd{C-x v =} or @kbd{C-x v ~} @iftex @@ -266,21 +180,10 @@ Thus, you can use it to compare a tagged version against the current files, or two tagged versions against each other. -@node Revision Tag Caveats -@subsubsection Revision Tag Caveats - - For SCCS, VC implements tags itself; these tags are visible only + On SCCS, VC implements tags itself; these tags are visible only through VC. Most later systems (including CVS, Subversion, bzr, git, -and hg) have a native tag facility, and VC uses it where -available; those tags will be visible even when you bypass VC. - - There is no support for VC tags using GNU Arch yet. - - Under older VCSes (SCCS, RCS, CVS, early versions of Subversion), -renaming and deletion could create some difficulties with tags. This is -not a VC-specific problem, but a general design issue in version -control systems that was not solved effectively until the earliest -third-generation systems. +and hg) have a native tag facility, and VC uses it where available; +those tags will be visible even when you bypass VC. In a file-oriented VCS, when you rename a registered file you need to rename its master along with it; the command @code{vc-rename-file} @@ -290,197 +193,13 @@ master file that no longer exists under the recorded name is invalid; VC can no longer retrieve it. It would be beyond the scope of this manual to explain enough about RCS and SCCS to explain how to update -the tags by hand. - - Using @code{vc-rename-file} makes the tag remain valid for -retrieval, but it does not solve all problems. For example, some of the -files in your program probably refer to others by name. At the very -least, the makefile probably mentions the file that you renamed. If you -retrieve an old tag, the renamed file is retrieved under its new -name, which is not the name that the makefile expects. So the program -won't really work as retrieved. - -@node Miscellaneous VC -@subsection Miscellaneous Commands and Features of VC - - This section explains the less-frequently-used features of VC. - -@menu -* Change Logs and VC:: Generating a change log file from log entries. -* Renaming and VC:: A command to rename both the source and master - file correctly. -* Version Headers:: Inserting version control headers into working files. -@end menu - -@node Change Logs and VC -@subsubsection Change Logs and VC - - If you use RCS or CVS for a program and also maintain a change log -file for it -@iftex -(@pxref{Change Log,,,emacs, the Emacs Manual}), -@end iftex -@ifnottex -(@pxref{Change Log}), -@end ifnottex -you can generate change log entries automatically from the version -control log entries: - -@table @kbd -@item C-x v a -@kindex C-x v a -@findex vc-update-change-log -Visit the current directory's change log file and, for registered files -in that directory, create new entries for versions checked in since the -most recent entry in the change log file. -(@code{vc-update-change-log}). - -This command works with RCS or CVS only, not with any of the other -back ends. - -@item C-u C-x v a -As above, but only find entries for the current buffer's file. - -@item M-1 C-x v a -As above, but find entries for all the currently visited files that are -maintained with version control. This works only with RCS, and it puts -all entries in the log for the default directory, which may not be -appropriate. -@end table - - For example, suppose the first line of @file{ChangeLog} is dated -1999-04-10, and that the only check-in since then was by Nathaniel -Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log -messages that start with `#'.}. Then @kbd{C-x v a} visits -@file{ChangeLog} and inserts text like this: - -@iftex -@medbreak -@end iftex -@smallexample -@group -1999-05-22 Nathaniel Bowditch - - * rcs2log: Ignore log messages that start with `#'. -@end group -@end smallexample -@iftex -@medbreak -@end iftex - -@noindent -You can then edit the new change log entry further as you wish. - - Some of the new change log entries may duplicate what's already in -ChangeLog. You will have to remove these duplicates by hand. - - Normally, the log entry for file @file{foo} is displayed as @samp{* -foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted -if the text of the log entry starts with @w{@samp{(@var{functionname}): -}}. For example, if the log entry for @file{vc.el} is -@samp{(vc-do-command): Check call-process status.}, then the text in -@file{ChangeLog} looks like this: - -@iftex -@medbreak -@end iftex -@smallexample -@group -1999-05-06 Nathaniel Bowditch - - * vc.el (vc-do-command): Check call-process status. -@end group -@end smallexample -@iftex -@medbreak -@end iftex - - When @kbd{C-x v a} adds several change log entries at once, it groups -related log entries together if they all are checked in by the same -author at nearly the same time. If the log entries for several such -files all have the same text, it coalesces them into a single entry. -For example, suppose the most recent check-ins have the following log -entries: - -@flushleft -@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.} -@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.} -@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.} -@end flushleft - -@noindent -They appear like this in @file{ChangeLog}: - -@iftex -@medbreak -@end iftex -@smallexample -@group -1999-04-01 Nathaniel Bowditch - - * vc.texinfo: Fix expansion typos. - - * vc.el, vc-hooks.el: Don't call expand-file-name. -@end group -@end smallexample -@iftex -@medbreak -@end iftex - - Normally, @kbd{C-x v a} separates log entries by a blank line, but you -can mark several related log entries to be clumped together (without an -intervening blank line) by starting the text of each related log entry -with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label -itself is not copied to @file{ChangeLog}. For example, suppose the log -entries are: - -@flushleft -@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.} -@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.} -@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.} -@end flushleft - -@noindent -Then the text in @file{ChangeLog} looks like this: - -@iftex -@medbreak -@end iftex -@smallexample -@group -1999-04-01 Nathaniel Bowditch - - * vc.texinfo: Fix expansion typos. - * vc.el, vc-hooks.el: Don't call expand-file-name. -@end group -@end smallexample -@iftex -@medbreak -@end iftex - - A log entry whose text begins with @samp{#} is not copied to -@file{ChangeLog}. For example, if you merely fix some misspellings in -comments, you can log the change with an entry beginning with @samp{#} -to avoid putting such trivia into @file{ChangeLog}. - -@node Renaming and VC -@subsubsection Renaming VC Work Files and Master Files - -@findex vc-rename-file - When you rename a registered file, you must also rename its master -file correspondingly to get proper results. Use @code{vc-rename-file} -to rename the source file as you specify, and rename its master file -accordingly. It also updates any tags (@pxref{Revision Tags}) that -mention the file, so that they use the new name; despite this, the -tag thus modified may not completely work (@pxref{Revision Tag Caveats}). - - Some back ends do not provide an explicit rename operation to their -repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v} -on the original and renamed buffers and provide the necessary edit -log. - - You cannot use @code{vc-rename-file} on a file that is locked by -someone else. +the tags by hand. Using @code{vc-rename-file} makes the tag remain +valid for retrieval, but it does not solve all problems. For example, +some of the files in your program probably refer to others by name. +At the very least, the makefile probably mentions the file that you +renamed. If you retrieve an old tag, the renamed file is retrieved +under its new name, which is not the name that the makefile expects. +So the program won't really work as retrieved. @node Version Headers @subsubsection Inserting Version Control Headers @@ -592,10 +311,9 @@ set this variable to @code{nil}. The order of systems in the list is significant: when you visit a file -registered in more than one system (@pxref{Local Version Control}), VC -uses the system that comes first in @code{vc-handled-backends} by -default. The order is also significant when you register a file for -the first time, see +registered in more than one system, VC uses the system that comes +first in @code{vc-handled-backends} by default. The order is also +significant when you register a file for the first time, see @iftex @ref{Registering,,,emacs, the Emacs Manual}, @end iftex @@ -708,37 +426,16 @@ @node CVS Options @subsubsection Options specific for CVS -@cindex locking (CVS) - By default, CVS does not use locking to coordinate the activities of -several users; anyone can change a work file at any time. However, -there are ways to restrict this, resulting in behavior that resembles -locking. - -@cindex CVSREAD environment variable (CVS) - For one thing, you can set the @env{CVSREAD} environment variable -(the value you use makes no difference). If this variable is defined, -CVS makes your work files read-only by default. In Emacs, you must -type @kbd{C-x v v} to make the file writable, so that editing works -in fact similar as if locking was used. Note however, that no actual -locking is performed, so several users can make their files writable -at the same time. When setting @env{CVSREAD} for the first time, make -sure to check out all your modules anew, so that the file protections -are set correctly. - -@cindex cvs watch feature -@cindex watching files (CVS) - Another way to achieve something similar to locking is to use the -@dfn{watch} feature of CVS. If a file is being watched, CVS makes it -read-only by default, and you must also use @kbd{C-x v v} in Emacs to -make it writable. VC calls @code{cvs edit} to make the file writable, -and CVS takes care to notify other developers of the fact that you -intend to change the file. See the CVS documentation for details on -using the watch feature. +@vindex vc-cvs-global-switches + You can specify additional command line options to pass to all CVS +operations in the variable @code{vc-cvs-global-switches}. These +switches are inserted immediately after the @code{cvs} command, before +the name of the operation to invoke. @vindex vc-stay-local @vindex vc-cvs-stay-local @cindex remote repositories (CVS) - When a file's repository is on a remote machine, VC tries to keep + When using a CVS repository on a remote machine, VC can try keeping network interactions to a minimum. This is controlled by the variable @code{vc-cvs-stay-local}. There is another variable, @code{vc-stay-local}, which enables the feature also for other back @@ -746,36 +443,58 @@ only about @code{vc-cvs-stay-local}, but everything applies to @code{vc-stay-local} as well. -If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses -only the entry in the local CVS subdirectory to determine the file's -state (and possibly information returned by previous CVS commands). -One consequence of this is that when you have modified a file, and -somebody else has already checked in other changes to the file, you -are not notified of it until you actually try to commit. (But you can -try to pick up any recent changes from the repository first, using -@kbd{C-x v m @key{RET}}, -@iftex -@pxref{Merging,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -@pxref{Merging}). -@end ifnottex - - When @code{vc-cvs-stay-local} is @code{t}, VC also makes local -version backups, so that simple diff and revert operations are -completely local (@pxref{Version Backups}). - - On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil}, -then VC queries the remote repository @emph{before} it decides what to -do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local -repositories. It also does not make any version backups. + If @code{vc-cvs-stay-local} is @code{t} (the default), VC determines +the version control status of each file using only the entry in the +local CVS subdirectory and the information returned by previous CVS +commands. As a consequence, if you have modified a file and somebody +else has checked in other changes, you will not be notified of the +conflict until you try to commit. + + If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the +remote repository @emph{before} it decides what to do in +@code{vc-next-action} (@kbd{C-x v v}), just as it does for local +repositories. You can also set @code{vc-cvs-stay-local} to a regular expression that is matched against the repository host name; VC then stays local only for repositories from hosts that match the pattern. -@vindex vc-cvs-global-switches - You can specify additional command line options to pass to all CVS -operations in the variable @code{vc-cvs-global-switches}. These -switches are inserted immediately after the @code{cvs} command, before -the name of the operation to invoke. +@cindex automatic version backups + When using a remote repository, Emacs normally makes @dfn{automatic +version backups} of the original versions of each edited file. These +local backups are made whenever you save the first changes to a file, +and they are removed after you commit your changes to the repository. +(Note that these are not the same as ordinary Emacs backup files; +@iftex +@pxref{Backup,,,emacs, the Emacs Manual}.) +@end iftex +@ifnottex +@pxref{Backup}.) +@end ifnottex +Commands like @kbd{C-x v =} and @kbd{C-x v u} make use of automatic +version backups, if possible, to avoid having to access the network. + + Setting @code{vc-cvs-stay-local} to @code{nil} disables the making +of automatic version backups. + +@cindex manual version backups + Automatic version backups have names of the form +@w{@code{@var{file}.~@var{version}.~}}. This is similar to the name +that @kbd{C-x v ~} saves old versions to +@iftex +(@pxref{Old Revisions,,,emacs, the Emacs Manual}), +@end iftex +@ifnottex +(@pxref{Old Revisions}), +@end ifnottex +except for the additional dot (@samp{.}) after the version. The +relevant VC commands can use both kinds of version backups. The main +difference is that the ``manual'' version backups made by @kbd{C-x v +~} are not deleted automatically when you commit. + +@cindex locking (CVS) + CVS does not use locking by default, but there are ways to enable +locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature; +see the CVS documentation for details. If that case, you can use +@kbd{C-x v v} in Emacs to toggle locking, as you would for a +locking-based version control system (@pxref{VC With A Locking VCS}). ------------------------------------------------------------ revno: 106709 committer: Jan D. branch nick: trunk timestamp: Wed 2011-12-21 09:04:19 +0100 message: Fix biggest memory leaks in NS-port. More remain. * emacs.c (ns_pool): New variable. (main): Assign ns_pool. (Fkill_emacs): Call ns_release_autorelease_pool. * nsfns.m (x_set_background_color): Assign return value from ns_index_color to face-background instead of NSColor*. (ns_implicitly_set_icon_type): Fix indentation. Change assignment in for loop to comparison. * nsfont.m (ns_spec_to_descriptor): Fix indentation, autorelease fdesc, release fdAttrs and tdict. (ns_get_covering_families): Release charset. (ns_findfonts): Release NSFontDescriptor created with new. (ns_uni_to_glyphs): Fix indentation. (setString): Release attrStr before assigning new value. * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree before returning. * nsterm.m (x_free_frame_resources): Release f->output_data.ns->miniimage (ns_index_color): Fix indentation. Do not retain color_table->colors[i]. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-21 06:37:49 +0000 +++ src/ChangeLog 2011-12-21 08:04:19 +0000 @@ -1,3 +1,29 @@ +2011-12-21 Jan Djärv + + * nsterm.m (x_free_frame_resources): Release + f->output_data.ns->miniimage + (ns_index_color): Fix indentation. Do not retain + color_table->colors[i]. + + * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree + before returning. + + * nsfns.m (x_set_background_color): Assign return value from + ns_index_color to face-background instead of NSColor*. + (ns_implicitly_set_icon_type): Fix indentation. + Change assignment in for loop to comparison. + + * emacs.c (ns_pool): New variable. + (main): Assign ns_pool. + (Fkill_emacs): Call ns_release_autorelease_pool. + + * nsfont.m (ns_spec_to_descriptor): Fix indentation, + autorelease fdesc, release fdAttrs and tdict. + (ns_get_covering_families): Release charset. + (ns_findfonts): Release NSFontDescriptor created with new. + (ns_uni_to_glyphs): Fix indentation. + (setString): Release attrStr before assigning new value. + 2011-12-18 Jan Djärv * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5 === modified file 'src/emacs.c' --- src/emacs.c 2011-12-12 05:32:49 +0000 +++ src/emacs.c 2011-12-21 08:04:19 +0000 @@ -321,6 +321,12 @@ pthread_t main_thread; #endif +#ifdef HAVE_NS +/* NS autrelease pool, for memory management. */ +static void *ns_pool; +#endif + + /* Handle bus errors, invalid instruction, etc. */ #ifndef FLOAT_CATCH_SIGILL @@ -1318,7 +1324,7 @@ = argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args); #ifdef HAVE_NS - ns_alloc_autorelease_pool (); + ns_pool = ns_alloc_autorelease_pool (); if (!noninteractive) { #ifdef NS_IMPL_COCOA @@ -2015,6 +2021,10 @@ shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil); +#ifdef HAVE_NS + ns_release_autorelease_pool (ns_pool); +#endif + /* If we have an auto-save list file, kill it because we are exiting Emacs deliberately (not crashing). Do it after shut_down_emacs, which does an auto-save. */ === modified file 'src/nsfns.m' --- src/nsfns.m 2011-12-10 14:01:08 +0000 +++ src/nsfns.m 2011-12-21 08:04:19 +0000 @@ -394,9 +394,8 @@ if (face) { col = ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f); - face->background - = (EMACS_UINT) [[col colorWithAlphaComponent: alpha] retain]; - [col release]; + face->background = ns_index_color + ([col colorWithAlphaComponent: alpha], f); update_face_from_frame_parameter (f, Qbackground_color, arg); } @@ -770,7 +769,7 @@ { Lisp_Object tem; EmacsView *view = FRAME_NS_VIEW (f); - id image =nil; + id image = nil; Lisp_Object chain, elt; NSAutoreleasePool *pool; BOOL setMini = YES; @@ -797,7 +796,7 @@ } for (chain = Vns_icon_type_alist; - (image = nil) && CONSP (chain); + image == nil && CONSP (chain); chain = XCDR (chain)) { elt = XCAR (chain); === modified file 'src/nsfont.m' --- src/nsfont.m 2011-12-12 05:32:49 +0000 +++ src/nsfont.m 2011-12-21 08:04:19 +0000 @@ -126,8 +126,8 @@ /* Converts FONT_WEIGHT, FONT_SLANT, FONT_WIDTH, plus family and script/lang to NSFont descriptor. Information under extra only needed for matching. */ #define STYLE_REF 100 -static NSFontDescriptor -*ns_spec_to_descriptor(Lisp_Object font_spec) +static NSFontDescriptor * +ns_spec_to_descriptor (Lisp_Object font_spec) { NSFontDescriptor *fdesc; NSMutableDictionary *fdAttrs = [NSMutableDictionary new]; @@ -152,8 +152,14 @@ [fdAttrs setObject: tdict forKey: NSFontTraitsAttribute]; fdesc = [NSFontDescriptor fontDescriptorWithFontAttributes: fdAttrs]; - if (family != nil) + if (family != nil) + { fdesc = [fdesc fontDescriptorWithFamily: family]; + [fdesc autorelease]; + } + + [fdAttrs release]; + [tdict release]; return fdesc; } @@ -469,6 +475,7 @@ if ([families count] > 0 || pct < 0.05) break; } + [charset release]; } #ifdef NS_IMPL_COCOA if ([families count] == 0) @@ -536,12 +543,14 @@ family = [fdesc objectForKey: NSFontFamilyAttribute]; if (family != nil && !foundItal && XINT (Flength (list)) > 0) { - NSFontDescriptor *sDesc = [[[NSFontDescriptor new] - fontDescriptorWithSymbolicTraits: NSFontItalicTrait] - fontDescriptorWithFamily: family]; + NSFontDescriptor *s1 = [NSFontDescriptor new]; + NSFontDescriptor *sDesc + = [[s1 fontDescriptorWithSymbolicTraits: NSFontItalicTrait] + fontDescriptorWithFamily: family]; list = Fcons (ns_descriptor_to_entity (sDesc, AREF (font_spec, FONT_EXTRA_INDEX), "synthItal"), list); + [s1 release]; } /* Return something if was a match and nothing found. */ @@ -1293,7 +1302,7 @@ abort (); /* create a string containing all Unicode characters in this block */ - for (idx = block<<8, i =0; i<0x100; idx++, i++) + for (idx = block<<8, i = 0; i < 0x100; idx++, i++) if (idx < 0xD800 || idx > 0xDFFF) unichars[i] = idx; else @@ -1309,7 +1318,7 @@ NSGlyphGenerator *glyphGenerator = [NSGlyphGenerator sharedGlyphGenerator]; /*NSCharacterSet *coveredChars = [nsfont coveredCharacterSet]; */ unsigned int numGlyphs = [font_info->nsfont numberOfGlyphs]; - NSUInteger gInd =0, cInd =0; + NSUInteger gInd = 0, cInd = 0; [glyphStorage setString: allChars font: font_info->nsfont]; [glyphGenerator generateGlyphsForGlyphStorage: glyphStorage @@ -1317,7 +1326,7 @@ glyphIndex: &gInd characterIndex: &cInd]; #endif glyphs = font_info->glyphs[block]; - for (i =0; i<0x100; i++, glyphs++) + for (i = 0; i < 0x100; i++, glyphs++) { #ifdef NS_IMPL_GNUSTEP g = unichars[i]; @@ -1425,6 +1434,8 @@ - (void) setString: (NSString *)str font: (NSFont *)font { [dict setObject: font forKey: NSFontAttributeName]; + if (attrStr != nil) + [attrStr release]; attrStr = [[NSAttributedString alloc] initWithString: str attributes: dict]; maxChar = [str length]; maxGlyph = 0; === modified file 'src/nsmenu.m' --- src/nsmenu.m 2011-12-18 14:50:19 +0000 +++ src/nsmenu.m 2011-12-21 08:04:19 +0000 @@ -404,6 +404,7 @@ items = FRAME_MENU_BAR_ITEMS (f); if (NILP (items)) { + free_menubar_widget_value_tree (first_wv); [pool release]; UNBLOCK_INPUT; return; @@ -431,6 +432,7 @@ if (i == n) { + free_menubar_widget_value_tree (first_wv); [pool release]; UNBLOCK_INPUT; return; === modified file 'src/nsterm.m' --- src/nsterm.m 2011-12-18 14:50:19 +0000 +++ src/nsterm.m 2011-12-21 08:04:19 +0000 @@ -1158,6 +1158,9 @@ xfree (f->output_data.ns); + if (f->output_data.ns->miniimage != nil) + [f->output_data.ns->miniimage release]; + [[view window] close]; [view release]; @@ -1351,7 +1354,7 @@ { struct ns_color_table *color_table = FRAME_NS_DISPLAY_INFO (f)->color_table; ptrdiff_t idx; - NSNumber *index; + ptrdiff_t i; if (!color_table->colors) { @@ -1364,21 +1367,13 @@ } /* do we already have this color ? */ - { - ptrdiff_t i; - for (i = 1; i < color_table->avail; i++) - { - if (color_table->colors[i] && [color_table->colors[i] isEqual: color]) - { - [color_table->colors[i] retain]; - return i; - } - } - } + for (i = 1; i < color_table->avail; i++) + if (color_table->colors[i] && [color_table->colors[i] isEqual: color]) + return i; if ([color_table->empty_indices count] > 0) { - index = [color_table->empty_indices anyObject]; + NSNumber *index = [color_table->empty_indices anyObject]; [color_table->empty_indices removeObject: index]; idx = [index unsignedLongValue]; } @@ -1411,20 +1406,20 @@ color_table = FRAME_NS_DISPLAY_INFO (f)->color_table; if (idx <= 0 || idx >= color_table->size) { - message1("ns_free_indexed_color: Color index out of range.\n"); + message1 ("ns_free_indexed_color: Color index out of range.\n"); return; } index = [NSNumber numberWithUnsignedInt: idx]; if ([color_table->empty_indices containsObject: index]) { - message1("ns_free_indexed_color: attempt to free already freed color.\n"); + message1 ("ns_free_indexed_color: attempt to free already freed color.\n"); return; } color = color_table->colors[idx]; [color release]; color_table->colors[idx] = nil; - [color_table->empty_indices addObject: [NSNumber numberWithUnsignedInt: idx]]; + [color_table->empty_indices addObject: index]; /*fprintf(stderr, "color_table: FREED %d\n",idx);*/ } ------------------------------------------------------------ revno: 106708 committer: Chong Yidong branch nick: trunk timestamp: Wed 2011-12-21 15:46:49 +0800 message: * vc-bzr.el (vc-bzr-rename-file): Don't pass ~ to Bzr in filename arg. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-20 07:45:20 +0000 +++ lisp/ChangeLog 2011-12-21 07:46:49 +0000 @@ -1,3 +1,8 @@ +2011-12-21 Chong Yidong + + * vc/vc-bzr.el (vc-bzr-rename-file): Don't pass ~ to Bzr in + filename argument. + 2011-12-20 Martin Rudalics * window.el (window-normalize-buffer-to-display): Remove. === modified file 'lisp/vc/vc-bzr.el' --- lisp/vc/vc-bzr.el 2011-11-24 08:21:03 +0000 +++ lisp/vc/vc-bzr.el 2011-12-21 07:46:49 +0000 @@ -764,7 +764,10 @@ (defun vc-bzr-rename-file (old new) "Rename file from OLD to NEW using `bzr mv'." - (vc-bzr-command "mv" nil 0 new old)) + (setq old (expand-file-name old)) + (setq new (expand-file-name new)) + (vc-bzr-command "mv" nil 0 new old) + (message "Renamed %s => %s" old new)) (defvar vc-bzr-annotation-table nil "Internal use.")