Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101031. ------------------------------------------------------------ revno: 101031 committer: Jay Belanger branch nick: trunk timestamp: Sun 2010-08-08 21:30:10 -0500 message: calc.texi (Customizing Calc): Rearrange description of new variables to match the presentation of other variables. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-08-08 21:12:29 +0000 +++ doc/misc/ChangeLog 2010-08-09 02:30:10 +0000 @@ -1,3 +1,8 @@ +2010-08-09 Jay Belanger + + * calc.texi (Customizing Calc): Rearrange description of new + variables to match the presentation of other variables. + 2010-08-08 Juanma Barranquero * org.texi (Footnotes, Tables in HTML export): Fix typos. === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2010-08-08 03:04:57 +0000 +++ doc/misc/calc.texi 2010-08-09 02:30:10 +0000 @@ -35214,6 +35214,7 @@ @defvar calc-highlight-selections-with-faces @defvarx calc-selected-face @defvarx calc-nonselected-face +See @ref{Displaying Selections}.@* The variable @code{calc-highlight-selections-with-faces} determines how selected sub-formulas are distinguished. If @code{calc-highlight-selections-with-faces} is nil, then @@ -35224,7 +35225,7 @@ then a selected sub-formula is distinguished either by displaying the non-selected portion of the formula with @code{calc-nonselected-face} or by displaying the selected sub-formula with -@code{calc-nonselected-face}. (@pxref{Displaying Selections}.) +@code{calc-nonselected-face}. @end defvar @defvar calc-multiplication-has-precedence === modified file 'lisp/calc/README' --- lisp/calc/README 2010-05-16 04:43:09 +0000 +++ lisp/calc/README 2010-08-09 02:30:10 +0000 @@ -74,6 +74,8 @@ Emacs 24.1 +* Added option to highlight selections using faces. + * Gave `calc-histogram' the option of using a vector to determine the bins. * Added "O" option prefix. ------------------------------------------------------------ revno: 101030 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-08-08 19:14:33 -0400 message: * tutorial.el (tutorial--default-keys): C-d is now bound to delete-forward-char. (Bug#6826) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-08 23:05:49 +0000 +++ lisp/ChangeLog 2010-08-08 23:14:33 +0000 @@ -1,5 +1,8 @@ 2010-08-08 Chong Yidong + * tutorial.el (tutorial--default-keys): C-d is now bound to + delete-forward-char (Bug#6826). + * mouse.el (mouse-drag-track): Remove accidentally-removed check for `double' value of mouse-1-click-follows-link (Bug#6807). === modified file 'lisp/tutorial.el' --- lisp/tutorial.el 2010-08-07 09:31:03 +0000 +++ lisp/tutorial.el 2010-08-08 23:14:33 +0000 @@ -252,7 +252,7 @@ ;; * INSERTING AND DELETING ;; C-u 8 * to insert ********. (delete-backward-char "\d") - (delete-char [?\C-d]) + (delete-forward-char [?\C-d]) (backward-kill-word [?\M-\d]) (kill-word [?\M-d]) (kill-line [?\C-k]) ------------------------------------------------------------ revno: 101029 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2010-08-09 01:05:49 +0200 message: Fix typos in ChangeLogs. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-08 21:57:34 +0000 +++ lisp/ChangeLog 2010-08-08 23:05:49 +0000 @@ -15,14 +15,11 @@ 2010-08-08 Kenichi Handa - * international/mule.el (define-charset): Store NAME as :base - property. - (ctext-non-standard-encodings-table): Pay attention to charset - aliases. + * international/mule.el (define-charset): Store NAME as :base property. + (ctext-non-standard-encodings-table): Pay attention to charset aliases. (ctext-pre-write-conversion): Sort ctext-standard-encodings by the current priority. Force using the designation of the specific - charset by adding `charset' text property. Improve the whole - algorithm. + charset by adding `charset' text property. Improve the whole algorithm. 2010-08-08 Juanma Barranquero @@ -35,8 +32,8 @@ * language/cyrillic.el: Don't add "microsoft-cp1251" to ctext-non-standard-encodings-alist here. - * international/mule.el (ctext-non-standard-encodings-alist): Add - "koi8-r" and "microsoft-cp1251". + * international/mule.el (ctext-non-standard-encodings-alist): + Add "koi8-r" and "microsoft-cp1251". (ctext-standard-encodings): New variable. (ctext-non-standard-encodings-table): List only elements for non-standard encodings. @@ -51,7 +48,7 @@ * simple.el (exchange-dot-and-mark): Mark obsolete, finally. -2010-08-03 Juanma Barranquero +2010-08-08 Juanma Barranquero * progmodes/which-func.el (which-func-format): Split help-echo text into lines, like other mode-line tooltips. @@ -59,26 +56,26 @@ * server.el (server-start): When using TCP sockets, force IPv4 and use a literal 127.0.0.1 for localhost. (Related to bug#6781.) -2010-08-02 Stefan Monnier +2010-08-08 Stefan Monnier * bindings.el (complete-symbol): Run completion-at-point as a fallback. -2010-08-02 Juanma Barranquero +2010-08-08 Juanma Barranquero * term.el (term-delimiter-argument-list): Reflow docstring. (term-read-input-ring, term-write-input-ring, term-send-input) (term-bol, term-erase-in-display, serial-supported-or-barf): Fix typos in docstrings. -2010-08-02 Stefan Monnier +2010-08-08 Stefan Monnier * bindings.el (function-key-map): Add a S-tab => backtab fallback. -2010-08-01 Juanma Barranquero +2010-08-08 Juanma Barranquero * dabbrev.el (dabbrev-completion): Fix typo in docstring. -2010-08-01 MON KEY (tiny change) +2010-08-08 MON KEY (tiny change) * emacs-lisp/syntax.el (syntax-ppss-toplevel-pos): Fix typo in docstring (bug#6747). @@ -119,9 +116,9 @@ 2010-08-07 Michael R. Mauger - * progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added - SQLite 3 keywords, functions and datatypes. - (sql-interactive-mode): Removed `comint-process-echoes' set to t + * progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): + Add SQLite 3 keywords, functions and datatypes. + (sql-interactive-mode): Remove `comint-process-echoes' set to t (Bug#6686). 2010-08-07 Chong Yidong @@ -154,7 +151,7 @@ 2010-08-06 Michael Albinus - * net/tramp.el (tramp-handle-start-file-process ): Set connection + * net/tramp.el (tramp-handle-start-file-process): Set connection property "vec". (tramp-process-sentinel): Use it for flushing the cache. We cannot do it via the process buffer, the buffer could be deleted === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-08 21:15:44 +0000 +++ src/ChangeLog 2010-08-08 23:05:49 +0000 @@ -90,10 +90,8 @@ * xselect.c (QPRIMARY): Move to keyboard.c. * keyboard.c (Vselect_active_regions): Move from simple.el. - (Vsaved_region_selection, Qx_set_selection, QPRIMARY, Qlazy): New - vars. - (command_loop_1): Set window selection prior to deactivating the - mark. + (Vsaved_region_selection, Qx_set_selection, QPRIMARY, Qlazy): New vars. + (command_loop_1): Set window selection prior to deactivating the mark. 2010-08-07 Juanma Barranquero @@ -113,8 +111,8 @@ * keyboard.h (quit_char): Add declaration. * process.h (QCport, QCspeed, QCprocess, QCbytesize, QCstopbits) - (QCparity, Qodd, Qeven, QCflowcontrol, Qhw, Qsw, QCsummary): Add - declarations. + (QCparity, Qodd, Qeven, QCflowcontrol, Qhw, Qsw, QCsummary): + Add declarations. * sysdep.c: * w32.c: Remove the above declarations. ------------------------------------------------------------ revno: 101028 author: Fran Litterio committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-08-08 18:13:53 -0400 message: Ensure that erc-toggle-debug-irc-protocol logs protocol data. http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg01000.html * erc-backend.el (erc-server-filter-function): Call erc-log-irc-protocol. * erc.el (erc-toggle-debug-irc-protocol): Bind erc-toggle-debug-irc-protocol to t. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2010-05-08 18:47:07 +0000 +++ lisp/erc/ChangeLog 2010-08-08 22:13:53 +0000 @@ -1,3 +1,11 @@ +2010-08-08 Fran Litterio + + * erc-backend.el (erc-server-filter-function): Call + erc-log-irc-protocol. + + * erc.el (erc-toggle-debug-irc-protocol): Bind + erc-toggle-debug-irc-protocol to t. + 2010-05-07 Chong Yidong * Version 23.2 released. === modified file 'lisp/erc/erc-backend.el' --- lisp/erc/erc-backend.el 2010-01-25 18:49:23 +0000 +++ lisp/erc/erc-backend.el 2010-08-08 22:13:53 +0000 @@ -574,6 +574,7 @@ nil (substring erc-server-filter-data (match-end 0)))) + (erc-log-irc-protocol line nil) (erc-parse-server-response process line))))))) (defsubst erc-server-reconnect-p (event) === modified file 'lisp/erc/erc.el' --- lisp/erc/erc.el 2010-01-25 18:49:23 +0000 +++ lisp/erc/erc.el 2010-08-08 22:13:53 +0000 @@ -2306,14 +2306,14 @@ (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n")) (insert (erc-make-notice "Kill this buffer to terminate protocol logging.\n\n"))) (use-local-map (make-sparse-keymap)) - (local-set-key (kbd "RET") 'erc-toggle-debug-irc-protocol)) + (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol)) (add-hook 'kill-buffer-hook #'(lambda () (setq erc-debug-irc-protocol nil)) nil 'local) (goto-char (point-max)) (let ((inhibit-read-only t)) (insert (erc-make-notice - (format "IRC protocol logging %s at %s -- Press ENTER to toggle logging.\n" + (format "IRC protocol logging %s at %s -- Press `t' to toggle logging.\n" (if erc-debug-irc-protocol "disabled" "enabled") (current-time-string)))))) (setq erc-debug-irc-protocol (not erc-debug-irc-protocol)) ------------------------------------------------------------ revno: 101027 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-08-08 17:57:34 -0400 message: Fix 2010-07-03 change to mouse-drag-track. * mouse.el (mouse-drag-track): Remove accidentally-removed check for `double' value of mouse-1-click-follows-link (Bug#6807). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-08 21:12:29 +0000 +++ lisp/ChangeLog 2010-08-08 21:57:34 +0000 @@ -1,3 +1,8 @@ +2010-08-08 Chong Yidong + + * mouse.el (mouse-drag-track): Remove accidentally-removed check + for `double' value of mouse-1-click-follows-link (Bug#6807). + 2010-08-08 Johan Bockgård * replace.el (replace-highlight): Bind isearch-forward and === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-08-07 19:39:04 +0000 +++ lisp/mouse.el 2010-08-08 21:57:34 +0000 @@ -929,6 +929,9 @@ ;; intangible text. (mouse-on-link-p start-posn))) (click-count (1- (event-click-count start-event))) + (remap-double-click (and on-link + (eq mouse-1-click-follows-link 'double) + (= click-count 1))) ;; Suppress automatic hscrolling, because that is a nuisance ;; when setting point near the right fringe (but see below). (automatic-hscrolling-saved automatic-hscrolling) @@ -941,6 +944,8 @@ (if (< (point) start-point) (goto-char start-point)) (setq start-point (point)) + (if remap-double-click + (setq click-count 0)) ;; Activate the region, using `mouse-start-end' to determine where ;; to put point and mark (e.g., double-click will select a word). ------------------------------------------------------------ revno: 101026 [merge] committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-08-08 17:15:44 -0400 message: Merge changes from emacs-23 branch. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-07-29 17:10:41 +0000 +++ doc/lispref/ChangeLog 2010-08-08 21:12:29 +0000 @@ -1,3 +1,17 @@ +2010-08-08 Christoph + + * control.texi (Handling Errors) : Fix arg name. + +2010-08-08 Juanma Barranquero + + * modes.texi (Defining Minor Modes): Use C-backspace, not C-delete. + Suggested by Štěpán Němec . + +2010-08-08 Juanma Barranquero + + * minibuf.texi (High-Level Completion): Document args of + `read-buffer-function' (bug#5625). + 2010-07-29 Jan Djärv * frames.texi (Layout Parameters): Add doc for tool-bar-position. === modified file 'doc/lispref/control.texi' --- doc/lispref/control.texi 2010-03-31 09:43:53 +0000 +++ doc/lispref/control.texi 2010-08-02 10:35:34 +0000 @@ -1039,7 +1039,7 @@ @xref{Definition of signal}. @end defspec -@defun error-message-string error-description +@defun error-message-string error-descriptor This function returns the error message string for a given error descriptor. It is useful if you want to handle an error by printing the usual error message for that error. @xref{Definition of signal}. === modified file 'doc/lispref/minibuf.texi' --- doc/lispref/minibuf.texi 2010-06-23 03:36:56 +0000 +++ doc/lispref/minibuf.texi 2010-07-28 00:15:49 +0000 @@ -1222,10 +1222,11 @@ @end defun @defopt read-buffer-function -This variable specifies how to read buffer names. For example, if you -set this variable to @code{iswitchb-read-buffer}, all Emacs commands -that call @code{read-buffer} to read a buffer name will actually use the -@code{iswitchb} package to read it. +This variable specifies how to read buffer names. The function is +called with the arguments passed to @code{read-buffer}. For example, +if you set this variable to @code{iswitchb-read-buffer}, all Emacs +commands that call @code{read-buffer} to read a buffer name will +actually use the @code{iswitchb} package to read it. @end defopt @defopt read-buffer-completion-ignore-case === modified file 'doc/lispref/modes.texi' --- doc/lispref/modes.texi 2010-07-27 01:37:23 +0000 +++ doc/lispref/modes.texi 2010-07-29 00:58:16 +0000 @@ -1494,7 +1494,7 @@ ;; The indicator for the mode line. " Hungry" ;; The minor mode bindings. - '(([C-delete] . hungry-electric-delete)) + '(([C-backspace] . hungry-electric-delete)) :group 'hunger) @end smallexample @@ -1526,8 +1526,8 @@ :lighter " Hungry" ;; The minor mode bindings. :keymap - '(([C-delete] . hungry-electric-delete) - ([C-M-delete] + '(([C-backspace] . hungry-electric-delete) + ([C-M-backspace] . (lambda () (interactive) (hungry-electric-delete t)))) === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-08-08 03:04:57 +0000 +++ doc/misc/ChangeLog 2010-08-08 21:12:29 +0000 @@ -1,3 +1,7 @@ +2010-08-08 Juanma Barranquero + + * org.texi (Footnotes, Tables in HTML export): Fix typos. + 2010-08-08 Jay Belanger * calc.texi (Making Selections, Selecting Subformulas) === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-08-07 10:26:42 +0000 +++ etc/ChangeLog 2010-08-08 21:12:29 +0000 @@ -1,3 +1,7 @@ +2010-08-08 Ken Brown + + * PROBLEMS: Mention problem with Cygwin 1.5.19. + 2010-08-07 Eli Zaretskii * NEWS: Mention the Hebrew translation. === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2010-08-05 17:11:32 +0000 +++ etc/PROBLEMS 2010-08-08 21:12:29 +0000 @@ -2344,6 +2344,14 @@ As of Emacs 22.1, there have been stability problems with Cygwin builds of Emacs using GCC 3. Cygwin users are advised to use GCC 4. +*** Building Emacs 23.3 and later will fail under Cygwin 1.5.19 + +This is a consequence of a change to src/dired.c on 2010-07-27. The +issue is that Cygwin 1.5.19 did not have d_ino in 'struct dirent'. +See + + http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg01266.html + *** Building the native MS-Windows port fails due to unresolved externals The linker error messages look like this: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-08 17:42:47 +0000 +++ lisp/ChangeLog 2010-08-08 21:12:29 +0000 @@ -1,3 +1,93 @@ +2010-08-08 Johan Bockgård + + * replace.el (replace-highlight): Bind isearch-forward and + isearch-error, ensuring that highlighting is updated if the user + switches the search direction (Bug#6808). + + * isearch.el (isearch-lazy-highlight-forward): New var. + (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search): + (isearch-lazy-highlight-update): Use it. + +2010-08-08 Kenichi Handa + + * international/mule.el (define-charset): Store NAME as :base + property. + (ctext-non-standard-encodings-table): Pay attention to charset + aliases. + (ctext-pre-write-conversion): Sort ctext-standard-encodings by the + current priority. Force using the designation of the specific + charset by adding `charset' text property. Improve the whole + algorithm. + +2010-08-08 Juanma Barranquero + + * emulation/pc-select.el (pc-selection-mode-hook) + (copy-region-as-kill-nomark, beginning-of-buffer-mark) + (pc-selection-mode): Fix typos in docstrings. + +2010-08-08 Kenichi Handa + + * language/cyrillic.el: Don't add "microsoft-cp1251" to + ctext-non-standard-encodings-alist here. + + * international/mule.el (ctext-non-standard-encodings-alist): Add + "koi8-r" and "microsoft-cp1251". + (ctext-standard-encodings): New variable. + (ctext-non-standard-encodings-table): List only elements for + non-standard encodings. + (ctext-pre-write-conversion): Adjusted for the above change. + Check ctext-standard-encodings. + + * international/mule-conf.el (compound-text): Doc fix. + (ctext-no-compositions): Doc fix. + (compound-text-with-extensions): Doc fix. + +2010-08-08 Stefan Monnier + + * simple.el (exchange-dot-and-mark): Mark obsolete, finally. + +2010-08-03 Juanma Barranquero + + * progmodes/which-func.el (which-func-format): Split help-echo text + into lines, like other mode-line tooltips. + + * server.el (server-start): When using TCP sockets, force IPv4 + and use a literal 127.0.0.1 for localhost. (Related to bug#6781.) + +2010-08-02 Stefan Monnier + + * bindings.el (complete-symbol): Run completion-at-point as a fallback. + +2010-08-02 Juanma Barranquero + + * term.el (term-delimiter-argument-list): Reflow docstring. + (term-read-input-ring, term-write-input-ring, term-send-input) + (term-bol, term-erase-in-display, serial-supported-or-barf): + Fix typos in docstrings. + +2010-08-02 Stefan Monnier + + * bindings.el (function-key-map): Add a S-tab => backtab fallback. + +2010-08-01 Juanma Barranquero + + * dabbrev.el (dabbrev-completion): Fix typo in docstring. + +2010-08-01 MON KEY (tiny change) + + * emacs-lisp/syntax.el (syntax-ppss-toplevel-pos): + Fix typo in docstring (bug#6747). + +2010-08-08 Leo + + * eshell/esh-io.el (eshell-get-target): Better detection of + read-only file (Bug#6762). + +2010-08-08 Juanma Barranquero + + * align.el (align-default-spacing): Doc fix. + (align-region-heuristic, align-regexp): Fix typos in docstrings. + 2010-08-08 Ulf Jasper * calendar/icalendar.el (icalendar-uid-format): Doc fix. === modified file 'lisp/align.el' --- lisp/align.el 2010-01-13 08:35:10 +0000 +++ lisp/align.el 2010-07-30 00:50:13 +0000 @@ -140,8 +140,8 @@ "An integer that represents the default amount of padding to use. If `align-to-tab-stop' is non-nil, this will represent the number of tab stops to use for alignment, rather than the number of spaces. -Each alignment rule can optionally override both this variable. See -`align-mode-alist'." +Each alignment rule can optionally override both this variable and +`align-to-tab-stop'. See `align-rules-list'." :type 'integer :group 'align) @@ -157,8 +157,8 @@ sections (whenever `align-region-separate' is non-nil, and not a string), this heuristic is used to determine how far before and after point we should search in looking for a region separator. Larger -values can mean slower perform in large files, although smaller values -may cause unexpected behavior at times." +values can mean slower performance in large files, although smaller +values may cause unexpected behavior at times." :type 'integer :group 'align) @@ -926,7 +926,7 @@ Joe (123) 456-7890 There is no predefined rule to handle this, but you could easily do it -using a REGEXP like \"(\". All you would have to do is to mark the +using a REGEXP like \"(\". All you would have to do is to mark the region, call `align-regexp' and type in that regular expression." (interactive (append === modified file 'lisp/bindings.el' --- lisp/bindings.el 2010-06-28 01:01:11 +0000 +++ lisp/bindings.el 2010-08-08 21:12:29 +0000 @@ -1054,6 +1054,9 @@ ;; so we can't distinguish those two keys, but usually we consider C-SPC ;; (rather than C-@) as the "canonical" binding. (define-key function-key-map [?\C-@] [?\C-\s]) +;; Many keyboards don't have a `backtab' key, so by convention the user +;; can use S-tab instead to access that binding. +(define-key function-key-map [S-tab] [backtab]) (define-key global-map [mouse-movement] 'ignore) === modified file 'lisp/dabbrev.el' --- lisp/dabbrev.el 2010-01-13 08:35:10 +0000 +++ lisp/dabbrev.el 2010-08-01 03:19:23 +0000 @@ -377,7 +377,7 @@ function pointed out by `dabbrev-friend-buffer-function' to find the completions. -If the prefix argument is 16 (which comes from \\[prefix-argument] \\[prefix-argument]), +If the prefix argument is 16 (which comes from \\[universal-argument] \\[universal-argument]), then it searches *all* buffers." (interactive "*P") (dabbrev--reset-global-variables) === modified file 'lisp/emacs-lisp/syntax.el' --- lisp/emacs-lisp/syntax.el 2010-01-13 08:35:10 +0000 +++ lisp/emacs-lisp/syntax.el 2010-08-01 00:24:55 +0000 @@ -52,7 +52,7 @@ (defun syntax-ppss-toplevel-pos (ppss) "Get the latest syntactically outermost position found in a syntactic scan. -PPSS is a scan state, as returned by `partial-parse-sexp' or `syntax-ppss'. +PPSS is a scan state, as returned by `parse-partial-sexp' or `syntax-ppss'. An \"outermost position\" means one that it is outside of any syntactic entity: outside of any parentheses, comments, or strings encountered in the scan. If no such position is recorded in PPSS (because the end of the scan was === modified file 'lisp/emulation/pc-select.el' --- lisp/emulation/pc-select.el 2010-07-10 18:52:53 +0000 +++ lisp/emulation/pc-select.el 2010-08-08 21:12:29 +0000 @@ -110,7 +110,7 @@ :group 'pc-select) (defcustom pc-selection-mode-hook nil - "The hook to run when pc-selection-mode is toggled." + "The hook to run when PC Selection mode is toggled." :type 'hook :group 'pc-select) @@ -261,7 +261,7 @@ (provide 'pc-select) (defun copy-region-as-kill-nomark (beg end) - "Save the region as if killed; but don't kill it; deactivate mark. + "Save the region as if killed, but don't kill it; deactivate mark. If `interprogram-cut-function' is non-nil, also save the text for a window system cut and paste. @@ -569,7 +569,7 @@ ;;;;;;;;;;;;;;;;;;;; (defun backward-char-mark (&optional arg) -"Ensure mark is active; move point left ARG characters (right if ARG negative). + "Ensure mark is active; move point left ARG characters (right if ARG negative). On attempt to pass beginning or end of buffer, stop and signal error." (interactive "p") (pc-select-ensure-mark) @@ -633,7 +633,7 @@ (defun scroll-up-mark (&optional arg) -"Ensure mark is active; scroll upward ARG lines; or near full screen if no ARG. + "Ensure mark is active; scroll upward ARG lines; or near full screen if no ARG. A near full screen is `next-screen-context-lines' less than a full screen. Negative ARG means scroll downward. When calling from a program, supply a number as argument or nil. @@ -654,7 +654,7 @@ of the accessible part of the buffer. Don't use this command in Lisp programs! -\(goto-char (p\oint-min)) is faster and avoids clobbering the mark." +\(goto-char (point-min)) is faster and avoids clobbering the mark." (interactive "P") (pc-select-ensure-mark) (let ((size (- (point-max) (point-min)))) @@ -841,7 +841,7 @@ ;;;###autoload (define-minor-mode pc-selection-mode - "Change mark behavior to emulate Motif, MAC or MS-Windows cut and paste style. + "Change mark behavior to emulate Motif, Mac or MS-Windows cut and paste style. This mode enables Delete Selection mode and Transient Mark mode. === modified file 'lisp/eshell/esh-io.el' --- lisp/eshell/esh-io.el 2010-01-13 08:35:10 +0000 +++ lisp/eshell/esh-io.el 2010-07-30 23:25:06 +0000 @@ -343,8 +343,9 @@ (let* ((exists (get-file-buffer target)) (buf (find-file-noselect target t))) (with-current-buffer buf - (if buffer-read-only + (if buffer-file-read-only (error "Cannot write to read-only file `%s'" target)) + (setq buffer-read-only nil) (set (make-local-variable 'eshell-output-file-buffer) (if (eq exists buf) 0 t)) (cond ((eq mode 'overwrite) === modified file 'lisp/international/mule-conf.el' --- lisp/international/mule-conf.el 2010-01-13 08:35:10 +0000 +++ lisp/international/mule-conf.el 2010-08-04 08:06:52 +0000 @@ -1410,9 +1410,10 @@ :flags '(ascii-at-eol ascii-at-cntl designation single-shift composition)) (define-coding-system 'compound-text - "Compound text based generic encoding for decoding unknown messages. - -This coding system does not support extended segments of CTEXT." + "Compound text based generic encoding. +This coding system is an extension of X's \"Compound Text Encoding\". +It encodes many characters using the normal ISO-2022 designation sequences, +but it doesn't support extended segments of CTEXT." :coding-type 'iso-2022 :mnemonic ?x :charset-list 'iso-2022 @@ -1432,7 +1433,7 @@ ;; not have a mime-charset property, to prevent it from showing up ;; close to the beginning of coding systems ordered by priority. (define-coding-system 'ctext-no-compositions - "Compound text based generic encoding for decoding unknown messages. + "Compound text based generic encoding. Like `compound-text', but does not produce escape sequences for compositions." :coding-type 'iso-2022 @@ -1445,8 +1446,9 @@ (define-coding-system 'compound-text-with-extensions "Compound text encoding with ICCCM Extended Segment extensions. -See the variable `ctext-non-standard-encodings-alist' for the -detail about how extended segments are handled. +See the variables `ctext-standard-encodings' and +`ctext-non-standard-encodings-alist' for the detail about how +extended segments are handled. This coding system should be used only for X selections. It is inappropriate for decoding and encoding files, process I/O, etc." === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2010-06-04 01:38:12 +0000 +++ lisp/international/mule.el 2010-08-08 21:12:29 +0000 @@ -282,6 +282,7 @@ (plist-put props :short-name (symbol-name name))) (or (plist-get props :long-name) (plist-put props :long-name (plist-get props :short-name))) + (plist-put props :base name) ;; We can probably get a worthwhile amount in purespace. (setq props (mapcar (lambda (elt) @@ -1465,7 +1466,9 @@ '(("big5-0" big5 2 big5) ("ISO8859-14" iso-8859-14 1 latin-iso8859-14) ("ISO8859-15" iso-8859-15 1 latin-iso8859-15) - ("gbk-0" gbk 2 chinese-gbk))) + ("gbk-0" gbk 2 chinese-gbk) + ("koi8-r" koi8-r 1 koi8-r) + ("microsoft-cp1251" windows-1251 1 windows-1251))) "Alist of non-standard encoding names vs the corresponding usages in CTEXT. It controls how extended segments of a compound text are handled @@ -1554,6 +1557,20 @@ (goto-char (point-min)) (- (point-max) (point))))) +(defvar ctext-standard-encodings + '(ascii latin-jisx0201 katakana-jisx0201 + latin-iso8859-1 latin-iso8859-2 latin-iso8859-3 latin-iso8859-4 + greek-iso8859-7 arabic-iso8859-6 hebrew-iso8859-8 cyrillic-iso8859-5 + latin-iso8859-9 + chinese-gb2312 japanese-jisx0208 korean-ksc5601) + "List of approved standard encodings (i.e. charsets) of X's Compound Text. +Coding-system `compound-text-with-extensions' encodes a character +belonging to any of those charsets using the normal ISO2022 +designation sequence unless the current language environment or +the variable `ctext-non-standard-encodings' decide to use an extended +segment of CTEXT for that character. See also the documentation +of `ctext-non-standard-encodings-alist'.") + ;; Return an alist of CHARSET vs CTEXT-USAGE-INFO generated from ;; `ctext-non-standard-encodings' and a list specified by the key ;; `ctext-non-standard-encodings' for the currrent language @@ -1565,115 +1582,94 @@ ;; is encoded using UTF-8 encoding extention. (defun ctext-non-standard-encodings-table () - (let (table) - ;; Setup charsets specified by the key - ;; `ctext-non-standard-encodings' for the current language - ;; environment and in `ctext-non-standard-encodings'. - (dolist (encoding (append - (get-language-info current-language-environment - 'ctext-non-standard-encodings) - ctext-non-standard-encodings)) - (let* ((slot (assoc encoding ctext-non-standard-encodings-alist)) + (let* ((table (append ctext-non-standard-encodings + (copy-sequence + (get-language-info current-language-environment + 'ctext-non-standard-encodings)))) + (tail table) + elt) + (while tail + (setq elt (car tail)) + (let* ((slot (assoc elt ctext-non-standard-encodings-alist)) (charset (nth 3 slot))) (if (charsetp charset) - (push (cons charset slot) table) - (dolist (cs charset) - (push (cons cs slot) table))))) - - ;; Next prepend charsets for ISO2022 designation sequence. - (dolist (charset charset-list) - (let ((final (plist-get (charset-plist charset) :iso-final-char))) - (if (and (integerp final) - (>= final #x40) (<= final #x7e) - ;; Exclude ascii and chinese-cns11643-X. - (not (eq charset 'ascii)) - (not (string-match "cns11643" (symbol-name charset)))) - (push (cons charset nil) table)))) - - ;; Returned reversed list so that the charsets specified by the - ;; key `ctext-non-standard-encodings' for the current language - ;; have the highest priority. - (nreverse table))) + (setcar tail + (cons (plist-get (charset-plist charset) :base) slot)) + (setcar tail (cons (car charset) slot)) + (dolist (cs (cdr charset)) + (setcdr tail + (cons (cons (plist-get (charset-plist (car cs)) :base) slot) + (cdr tail))) + (setq tail (cdr tail)))) + (setq tail (cdr tail)))) + table)) (defun ctext-pre-write-conversion (from to) "Encode characters between FROM and TO as Compound Text w/Extended Segments. -If FROM is a string, or if the current buffer is not the one set up for us -by `encode-coding-string', generate a new temp buffer, insert the text, -and convert it in the temporary buffer. Otherwise, convert in-place." +If FROM is a string, generate a new temp buffer, insert the text, +and convert it in the temporary buffer. Otherwise, convert +in-place." (save-match-data ;; Setup a working buffer if necessary. (when (stringp from) (set-buffer (generate-new-buffer " *temp")) (set-buffer-multibyte (multibyte-string-p from)) - (insert from)) - - ;; Now we can encode the whole buffer. - (let ((encoding-table (ctext-non-standard-encodings-table)) - last-coding-system-used - last-pos last-encoding-info - encoding-info end-pos ch) - (goto-char (setq last-pos (point-min))) - (setq end-pos (point-marker)) - (while (re-search-forward "[^\000-\177]+" nil t) - ;; Found a sequence of non-ASCII characters. - (setq last-pos (match-beginning 0) - ch (char-after last-pos) - last-encoding-info (catch 'tag - (dolist (elt encoding-table) - (if (encode-char ch (car elt)) - (throw 'tag (cdr elt)))) - 'utf-8)) - (set-marker end-pos (match-end 0)) - (goto-char (1+ last-pos)) - (catch 'tag - (while t - (setq encoding-info - (if (< (point) end-pos) - (catch 'tag - (setq ch (following-char)) - (dolist (elt encoding-table) - (if (encode-char ch (car elt)) - (throw 'tag (cdr elt)))) - 'utf-8))) - (unless (eq last-encoding-info encoding-info) - (cond ((consp last-encoding-info) - ;; Encode the previous range using an extended - ;; segment. - (let ((encoding-name (car last-encoding-info)) - (coding-system (nth 1 last-encoding-info)) - (noctets (nth 2 last-encoding-info)) - len) - (encode-coding-region last-pos (point) coding-system) - (setq len (+ (length encoding-name) 1 - (- (point) last-pos))) - ;; According to the spec of CTEXT, it is not - ;; necessary to produce this extra designation - ;; sequence, but some buggy application - ;; (e.g. crxvt-gb) requires it. - (insert "\e(B") - (save-excursion - (goto-char last-pos) - (insert (format "\e%%/%d" noctets)) - (insert-byte (+ (/ len 128) 128) 1) - (insert-byte (+ (% len 128) 128) 1) - (insert encoding-name) - (insert 2)))) - ((eq last-encoding-info 'utf-8) - ;; Encode the previous range using UTF-8 encoding - ;; extention. - (encode-coding-region last-pos (point) 'mule-utf-8) - (save-excursion - (goto-char last-pos) - (insert "\e%G")) - (insert "\e%@"))) - (setq last-pos (point) - last-encoding-info encoding-info)) - (if (< (point) end-pos) - (forward-char 1) - (throw 'tag nil))))) - (set-marker end-pos nil) - (goto-char (point-min)))) + (insert from) + (setq from 1 to (point-max))) + (save-restriction + (narrow-to-region from to) + (goto-char from) + (let ((encoding-table (ctext-non-standard-encodings-table)) + (charset-list (sort-charsets + (copy-sequence ctext-standard-encodings))) + (end-pos (make-marker)) + last-coding-system-used + last-pos charset encoding-info) + (dolist (elt encoding-table) + (push (car elt) charset-list)) + (setq end-pos (point-marker)) + (while (re-search-forward "[^\0-\177]+" nil t) + ;; Found a sequence of non-ASCII characters. + (set-marker end-pos (match-end 0)) + (goto-char (match-beginning 0)) + (setq last-pos (point) + charset (char-charset (following-char) charset-list)) + (forward-char 1) + (while (and (< (point) end-pos) + (eq charset (char-charset (following-char) charset-list))) + (forward-char 1)) + (if charset + (if (setq encoding-info (cdr (assq charset encoding-table))) + ;; Encode this range using an extended segment. + (let ((encoding-name (car encoding-info)) + (coding-system (nth 1 encoding-info)) + (noctets (nth 2 encoding-info)) + len) + (encode-coding-region last-pos (point) coding-system) + (setq len (+ (length encoding-name) 1 + (- (point) last-pos))) + ;; According to the spec of CTEXT, it is not + ;; necessary to produce this extra designation + ;; sequence, but some buggy application + ;; (e.g. crxvt-gb) requires it. + (insert "\e(B") + (save-excursion + (goto-char last-pos) + (insert (format "\e%%/%d" noctets)) + (insert-byte (+ (/ len 128) 128) 1) + (insert-byte (+ (% len 128) 128) 1) + (insert encoding-name) + (insert 2))) + ;; Encode this range as characters in CHARSET. + (put-text-property last-pos (point) 'charset charset)) + ;; Encode this range using UTF-8 encoding extention. + (encode-coding-region last-pos (point) 'mule-utf-8) + (save-excursion + (goto-char last-pos) + (insert "\e%G")) + (insert "\e%@"))) + (goto-char (point-min))))) ;; Must return nil, as build_annotations_2 expects that. nil) === modified file 'lisp/isearch.el' --- lisp/isearch.el 2010-06-06 09:52:13 +0000 +++ lisp/isearch.el 2010-08-08 21:12:29 +0000 @@ -2581,6 +2581,7 @@ (defvar isearch-lazy-highlight-case-fold-search nil) (defvar isearch-lazy-highlight-regexp nil) (defvar isearch-lazy-highlight-space-regexp nil) +(defvar isearch-lazy-highlight-forward nil) (defun lazy-highlight-cleanup (&optional force) "Stop lazy highlighting and remove extra highlighting from current buffer. @@ -2620,7 +2621,9 @@ (not (= (window-start) isearch-lazy-highlight-window-start)) (not (= (window-end) ; Window may have been split/joined. - isearch-lazy-highlight-window-end)))) + isearch-lazy-highlight-window-end)) + (not (eq isearch-forward + isearch-lazy-highlight-forward)))) ;; something important did indeed change (lazy-highlight-cleanup t) ;kill old loop & remove overlays (when (not isearch-error) @@ -2635,7 +2638,8 @@ isearch-lazy-highlight-case-fold-search isearch-case-fold-search isearch-lazy-highlight-regexp isearch-regexp isearch-lazy-highlight-wrapped nil - isearch-lazy-highlight-space-regexp search-whitespace-regexp) + isearch-lazy-highlight-space-regexp search-whitespace-regexp + isearch-lazy-highlight-forward isearch-forward) (unless (equal isearch-string "") (setq isearch-lazy-highlight-timer (run-with-idle-timer lazy-highlight-initial-delay nil @@ -2651,7 +2655,8 @@ (search-invisible nil) ; don't match invisible text (retry t) (success nil) - (bound (if isearch-forward + (isearch-forward isearch-lazy-highlight-forward) + (bound (if isearch-lazy-highlight-forward (min (or isearch-lazy-highlight-end-limit (point-max)) (if isearch-lazy-highlight-wrapped isearch-lazy-highlight-start @@ -2687,7 +2692,7 @@ (select-window isearch-lazy-highlight-window)) (save-excursion (save-match-data - (goto-char (if isearch-forward + (goto-char (if isearch-lazy-highlight-forward isearch-lazy-highlight-end isearch-lazy-highlight-start)) (while looping @@ -2700,7 +2705,7 @@ (let ((mb (match-beginning 0)) (me (match-end 0))) (if (= mb me) ;zero-length match - (if isearch-forward + (if isearch-lazy-highlight-forward (if (= mb (if isearch-lazy-highlight-wrapped isearch-lazy-highlight-start (window-end))) @@ -2720,7 +2725,7 @@ (overlay-put ov 'priority 1000) (overlay-put ov 'face lazy-highlight-face) (overlay-put ov 'window (selected-window)))) - (if isearch-forward + (if isearch-lazy-highlight-forward (setq isearch-lazy-highlight-end (point)) (setq isearch-lazy-highlight-start (point))))) @@ -2730,7 +2735,7 @@ (setq looping nil nomore t) (setq isearch-lazy-highlight-wrapped t) - (if isearch-forward + (if isearch-lazy-highlight-forward (progn (setq isearch-lazy-highlight-end (window-start)) (goto-char (max (or isearch-lazy-highlight-start-limit (point-min)) === modified file 'lisp/language/cyrillic.el' --- lisp/language/cyrillic.el 2010-01-13 08:35:10 +0000 +++ lisp/language/cyrillic.el 2010-08-04 08:06:52 +0000 @@ -239,13 +239,6 @@ (documentation . "Support for Tajik using KOI8-T.")) '("Cyrillic")) -(let ((elt `("microsoft-cp1251" windows-1251 1 - ,(get 'encode-windows-1251 'translation-table))) - (slot (assoc "microsoft-cp1251" ctext-non-standard-encodings-alist))) - (if slot - (setcdr slot (cdr elt)) - (push elt ctext-non-standard-encodings-alist))) - (set-language-info-alist "Bulgarian" `((coding-system windows-1251) (coding-priority windows-1251) === modified file 'lisp/progmodes/which-func.el' --- lisp/progmodes/which-func.el 2010-01-13 08:35:10 +0000 +++ lisp/progmodes/which-func.el 2010-08-03 16:39:37 +0000 @@ -145,7 +145,9 @@ local-map ,which-func-keymap face which-func ;;mouse-face highlight ; currently not evaluated :-( - help-echo "mouse-1: go to beginning, mouse-2: toggle rest visibility, mouse-3: go to end") + help-echo "mouse-1: go to beginning\n\ +mouse-2: toggle rest visibility\n\ +mouse-3: go to end") "]") "Format for displaying the function in the mode line." :group 'which-func === modified file 'lisp/replace.el' --- lisp/replace.el 2010-05-20 22:49:53 +0000 +++ lisp/replace.el 2010-08-08 21:12:29 +0000 @@ -1979,7 +1979,9 @@ (let ((isearch-string string) (isearch-regexp regexp) (search-whitespace-regexp nil) - (isearch-case-fold-search case-fold)) + (isearch-case-fold-search case-fold) + (isearch-forward t) + (isearch-error nil)) ;; Set isearch-word to nil because word-replace is regexp-based, ;; so `isearch-search-fun' should not use `word-search-forward'. (if (and isearch-word isearch-regexp) (setq isearch-word nil)) === modified file 'lisp/server.el' --- lisp/server.el 2010-08-03 12:22:23 +0000 +++ lisp/server.el 2010-08-08 21:12:29 +0000 @@ -563,9 +563,9 @@ :coding 'raw-text-unix ;; The other args depend on the kind of socket used. (if server-use-tcp - (list :family nil + (list :family 'ipv4 ;; We're not ready for IPv6 yet :service t - :host (or server-host 'local) + :host (or server-host "127.0.0.1") ;; See bug#6781 :plist '(:authenticated nil)) (list :family 'local :service server-file === modified file 'lisp/simple.el' --- lisp/simple.el 2010-08-07 20:10:30 +0000 +++ lisp/simple.el 2010-08-08 21:12:29 +0000 @@ -3941,7 +3941,8 @@ (setq mark-ring (cdr mark-ring))) (deactivate-mark)) -(defalias 'exchange-dot-and-mark 'exchange-point-and-mark) +(define-obsolete-function-alias + 'exchange-dot-and-mark 'exchange-point-and-mark "23.3") (defun exchange-point-and-mark (&optional arg) "Put the mark where point is now, and point where the mark is now. This command works even when the mark is not active, === modified file 'lisp/term.el' --- lisp/term.el 2010-05-25 02:11:08 +0000 +++ lisp/term.el 2010-08-08 21:12:29 +0000 @@ -502,8 +502,8 @@ (defvar term-delimiter-argument-list () "List of characters to recognize as separate arguments in input. Strings comprising a character in this list will separate the arguments -surrounding them, and also be regarded as arguments in their own right (unlike -whitespace). See `term-arguments'. +surrounding them, and also be regarded as arguments in their own right +\(unlike whitespace). See `term-arguments'. Defaults to the empty list. For shells, a good value is (?\\| ?& ?< ?> ?\\( ?\\) ?\\;). @@ -1516,7 +1516,7 @@ ;; term-replace-by-expanded-history-before-point Workhorse function. (defun term-read-input-ring (&optional silent) - "Sets the buffer's `term-input-ring' from a history file. + "Set the buffer's `term-input-ring' from a history file. The name of the file is given by the variable `term-input-ring-file-name'. The history ring is of size `term-input-ring-size', regardless of file size. If `term-input-ring-file-name' is nil this function does nothing. @@ -1564,7 +1564,7 @@ term-input-ring-index nil))))) (defun term-write-input-ring () - "Writes the buffer's `term-input-ring' to a history file. + "Write the buffer's `term-input-ring' to a history file. The name of the file is given by the variable `term-input-ring-file-name'. The original contents of the file are lost if `term-input-ring' is not empty. If `term-input-ring-file-name' is nil this function does nothing. @@ -1996,12 +1996,12 @@ "Send input to process. After the process output mark, sends all text from the process mark to point as input to the process. Before the process output mark, calls value -of variable term-get-old-input to retrieve old input, copies it to the +of variable `term-get-old-input' to retrieve old input, copies it to the process mark, and sends it. A terminal newline is also inserted into the buffer and sent to the process. The list of function names contained in the value of `term-input-filter-functions' is called on the input before sending it. The input is entered into the input history ring, if the value of variable -term-input-filter returns non-nil when called on the input. +`term-input-filter' returns non-nil when called on the input. Any history reference may be expanded depending on the value of the variable `term-input-autoexpand'. The list of function names contained in the value @@ -2137,7 +2137,7 @@ (term-send-string proc "\n")) (defun term-bol (arg) - "Goes to the beginning of line, then skips past the prompt, if any. + "Go to the beginning of line, then skip past the prompt, if any. If a prefix argument is given (\\[universal-argument]), then no prompt skip -- go straight to column 0. @@ -3760,7 +3760,7 @@ (goto-char saved-point)))) (defun term-erase-in-display (kind) - "Erases (that is blanks out) part of the window. + "Erase (that is blank out) part of the window. If KIND is 0, erase from (point) to (point-max); if KIND is 1, erase from home to point; else erase from home to point-max." (term-handle-deferred-scroll) @@ -4166,7 +4166,7 @@ ;; I need a make-term that doesn't surround with *s -mm (defun term-ansi-make-term (name program &optional startfile &rest switches) -"Make a term process NAME in a buffer, running PROGRAM. + "Make a term process NAME in a buffer, running PROGRAM. The name of the buffer is NAME. If there is already a running process in that buffer, it is not restarted. Optional third arg STARTFILE is the name of a file to send the contents of to @@ -4267,7 +4267,7 @@ for special serial ports that cannot be configured.") (defun serial-supported-or-barf () - "Signal an error if serial processes are not supported" + "Signal an error if serial processes are not supported." (unless (fboundp 'make-serial-process) (error "Serial processes are not supported on this system"))) === modified file 'nt/ChangeLog' --- nt/ChangeLog 2010-08-02 23:20:48 +0000 +++ nt/ChangeLog 2010-08-08 21:12:29 +0000 @@ -1,3 +1,8 @@ +2010-08-08 Óscar Fuentes + + * cmdproxy.c (main): Use _snprintf instead of wsprintf, + which has a 1024 char limit on Windows (bug#6647). + 2010-08-02 Juanma Barranquero * config.nt (TIME_WITH_SYS_TIME): Remove #undef, unused (bug#6754). === modified file 'nt/cmdproxy.c' --- nt/cmdproxy.c 2010-07-20 20:21:03 +0000 +++ nt/cmdproxy.c 2010-08-08 21:12:29 +0000 @@ -35,6 +35,9 @@ #include /* getenv */ #include /* strlen */ +/* We don't want to include stdio.h because we are already duplicating + lots of it here */ +extern int _snprintf (char *buffer, size_t count, const char *format, ...); /******* Mock C library routines *********************************/ @@ -604,6 +607,7 @@ { char * p; int extra_arg_space = 0; + int maxlen, remlen; int run_command_dot_com; progname = getenv ("COMSPEC"); @@ -635,21 +639,27 @@ case path contains spaces (fortunately it can't contain quotes, since they are illegal in path names). */ - buf = p = alloca (strlen (progname) + extra_arg_space + - strlen (cmdline) + 16); + remlen = maxlen = + strlen (progname) + extra_arg_space + strlen (cmdline) + 16; + buf = p = alloca (maxlen + 1); /* Quote progname in case it contains spaces. */ - p += wsprintf (p, "\"%s\"", progname); + p += _snprintf (p, remlen, "\"%s\"", progname); + remlen = maxlen - (p - buf); /* Include pass_through_args verbatim; these are just switches so should not need quoting. */ for (argv = pass_through_args; *argv != NULL; ++argv) - p += wsprintf (p, " %s", *argv); + { + p += _snprintf (p, remlen, " %s", *argv); + remlen = maxlen - (p - buf); + } if (run_command_dot_com) - wsprintf(p, " /e:%d /c %s", envsize, cmdline); + _snprintf (p, remlen, " /e:%d /c %s", envsize, cmdline); else - wsprintf(p, " /c %s", cmdline); + _snprintf (p, remlen, " /c %s", cmdline); + remlen = maxlen - (p - buf); cmdline = buf; } else @@ -669,19 +679,27 @@ else path[0] = '\0'; - cmdline = p = alloca (strlen (progname) + extra_arg_space + - strlen (path) + 13); + remlen = maxlen = + strlen (progname) + extra_arg_space + strlen (path) + 13; + cmdline = p = alloca (maxlen + 1); /* Quote progname in case it contains spaces. */ - p += wsprintf (p, "\"%s\" %s", progname, path); + p += _snprintf (p, remlen, "\"%s\" %s", progname, path); + remlen = maxlen - (p - cmdline); /* Include pass_through_args verbatim; these are just switches so should not need quoting. */ for (argv = pass_through_args; *argv != NULL; ++argv) - p += wsprintf (p, " %s", *argv); + { + p += _snprintf (p, remlen, " %s", *argv); + remlen = maxlen - (p - cmdline); + } if (run_command_dot_com) - wsprintf (p, " /e:%d", envsize); + { + _snprintf (p, remlen, " /e:%d", envsize); + remlen = maxlen - (p - cmdline); + } } } === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-08 21:03:45 +0000 +++ src/ChangeLog 2010-08-08 21:15:44 +0000 @@ -1,3 +1,35 @@ +2010-08-08 Kenichi Handa + + * charset.c: Include + (struct charset_sort_data): New struct. + (charset_compare): New function. + (Fsort_charsets): New funciton. + (syms_of_charset): Declare Fsort_charsets as a Lisp function. + + * coding.c (decode_coding_iso_2022): Fix checking of dimension + number in CTEXT extended segment. + +2010-08-08 Juanma Barranquero + + * w32fns.c (syms_of_w32fns) : Fix typo in docstring. + * xfns.c (syms_of_xfns) : Reflow docstring. + +2010-08-08 Juanma Barranquero + + * fns.c (Fsubstring_no_properties, Fnthcdr, Ffeaturep) + (Fhash_table_size): Fix typos in docstrings. + (Fmake_hash_table): Doc fix. + +2010-08-08 Juanma Barranquero + + * minibuf.c (syms_of_minibuf) : + Doc fix (bug#5625). + +2010-08-08 Ken Brown + + * dired.c (DIRENTRY_NONEMPTY) [cygwin]: Use d_ino instead of + the MSDOS definition. + 2010-08-08 Dan Nicolaescu Use const char* instead of char*. === modified file 'src/charset.c' --- src/charset.c 2010-08-08 21:03:45 +0000 +++ src/charset.c 2010-08-08 21:15:44 +0000 @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -2071,23 +2072,22 @@ charset = CHAR_CHARSET (XINT (ch)); else { - Lisp_Object charset_list; - if (CONSP (restriction)) { - for (charset_list = Qnil; CONSP (restriction); - restriction = XCDR (restriction)) + int c = XFASTINT (ch); + + for (; CONSP (restriction); restriction = XCDR (restriction)) { - int id; + struct charset *charset; - CHECK_CHARSET_GET_ID (XCAR (restriction), id); - charset_list = Fcons (make_number (id), charset_list); + CHECK_CHARSET_GET_CHARSET (XCAR (restriction), charset); + if (ENCODE_CHAR (charset, c) != CHARSET_INVALID_CODE (charset)) + return XCAR (restriction); } - charset_list = Fnreverse (charset_list); + return Qnil; } - else - charset_list = coding_system_charset_list (restriction); - charset = char_charset (XINT (ch), charset_list, NULL); + restriction = coding_system_charset_list (restriction); + charset = char_charset (XINT (ch), restriction, NULL); if (! charset) return Qnil; } @@ -2238,6 +2238,69 @@ return make_number (id); } +struct charset_sort_data +{ + Lisp_Object charset; + int id; + int priority; +}; + +static int +charset_compare (const void *d1, const void *d2) +{ + const struct charset_sort_data *data1 = d1, *data2 = d2; + return (data1->priority - data2->priority); +} + +DEFUN ("sort-charsets", Fsort_charsets, Ssort_charsets, 1, 1, 0, + doc: /* Sort charset list CHARSETS by a priority of each charset. +Return the sorted list. CHARSETS is modified by side effects. +See also `charset-priority-list' and `set-charset-priority'. */) + (Lisp_Object charsets) +{ + Lisp_Object len = Flength (charsets); + int n = XFASTINT (len), i, j, done; + Lisp_Object tail, elt, attrs; + struct charset_sort_data *sort_data; + int id, min_id, max_id; + USE_SAFE_ALLOCA; + + if (n == 0) + return Qnil; + SAFE_ALLOCA (sort_data, struct charset_sort_data *, sizeof (*sort_data) * n); + for (tail = charsets, i = 0; CONSP (tail); tail = XCDR (tail), i++) + { + elt = XCAR (tail); + CHECK_CHARSET_GET_ATTR (elt, attrs); + sort_data[i].charset = elt; + sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs)); + if (i == 0) + min_id = max_id = id; + else if (id < min_id) + min_id = id; + else if (id > max_id) + max_id = id; + } + for (done = 0, tail = Vcharset_ordered_list, i = 0; + done < n && CONSP (tail); tail = XCDR (tail), i++) + { + elt = XCAR (tail); + id = XFASTINT (elt); + if (id >= min_id && id <= max_id) + for (j = 0; j < n; j++) + if (sort_data[j].id == id) + { + sort_data[j].priority = i; + done++; + } + } + qsort (sort_data, n, sizeof *sort_data, charset_compare); + for (i = 0, tail = charsets; CONSP (tail); tail = XCDR (tail), i++) + XSETCAR (tail, sort_data[i].charset); + SAFE_FREE (); + return charsets; +} + void init_charset (void) @@ -2340,6 +2403,7 @@ defsubr (&Scharset_priority_list); defsubr (&Sset_charset_priority); defsubr (&Scharset_id_internal); + defsubr (&Ssort_charsets); DEFVAR_LISP ("charset-map-path", &Vcharset_map_path, doc: /* *List of directories to search for charset map files. */); === modified file 'src/coding.c' --- src/coding.c 2010-08-08 21:03:45 +0000 +++ src/coding.c 2010-08-08 21:15:44 +0000 @@ -3902,7 +3902,7 @@ int size; ONE_MORE_BYTE (dim); - if (dim < 0 || dim > 4) + if (dim < '0' || dim > '4') goto invalid_code; ONE_MORE_BYTE (M); if (M < 128) === modified file 'src/dired.c' --- src/dired.c 2010-08-06 00:16:24 +0000 +++ src/dired.c 2010-08-08 21:12:29 +0000 @@ -65,8 +65,7 @@ #endif /* HAVE_DIRENT_H */ -/* Some versions of Cygwin don't have d_ino in `struct dirent'. */ -#if defined(MSDOS) || defined(__CYGWIN__) +#ifdef MSDOS #define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0) #else #define DIRENTRY_NONEMPTY(p) ((p)->d_ino) === modified file 'src/fns.c' --- src/fns.c 2010-08-05 23:34:12 +0000 +++ src/fns.c 2010-08-08 21:12:29 +0000 @@ -225,9 +225,8 @@ return Qt; } -DEFUN ("compare-strings", Fcompare_strings, - Scompare_strings, 6, 7, 0, -doc: /* Compare the contents of two strings, converting to multibyte if needed. +DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0, + doc: /* Compare the contents of two strings, converting to multibyte if needed. In string STR1, skip the first START1 characters and stop at END1. In string STR2, skip the first START2 characters and stop at END2. END1 and END2 default to the full lengths of the respective strings. @@ -1199,7 +1198,7 @@ DEFUN ("substring-no-properties", Fsubstring_no_properties, Ssubstring_no_properties, 1, 3, 0, doc: /* Return a substring of STRING, without text properties. -It starts at index FROM and ending before TO. +It starts at index FROM and ends before TO. TO may be nil or omitted; then the substring runs to the end of STRING. If FROM is nil or omitted, the substring starts at the beginning of STRING. If FROM or TO is negative, it counts from the end. @@ -1291,7 +1290,7 @@ } DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0, - doc: /* Take cdr N times on LIST, returns the result. */) + doc: /* Take cdr N times on LIST, return the result. */) (Lisp_Object n, Lisp_Object list) { register int i, num; @@ -1328,7 +1327,7 @@ } DEFUN ("member", Fmember, Smember, 2, 2, 0, -doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'. + doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'. The value is actually the tail of LIST whose car is ELT. */) (register Lisp_Object elt, Lisp_Object list) { @@ -1346,7 +1345,7 @@ } DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, -doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'. + doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'. The value is actually the tail of LIST whose car is ELT. */) (register Lisp_Object elt, Lisp_Object list) { @@ -1372,7 +1371,7 @@ } DEFUN ("memql", Fmemql, Smemql, 2, 2, 0, -doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'. + doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'. The value is actually the tail of LIST whose car is ELT. */) (register Lisp_Object elt, Lisp_Object list) { @@ -2702,7 +2701,7 @@ Lisp_Object Vfeatures, Qsubfeatures; DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0, - doc: /* Returns t if FEATURE is present in this Emacs. + doc: /* Return t if FEATURE is present in this Emacs. Use this to conditionalize execution of lisp code based on the presence or absence of Emacs or environment extensions. @@ -4425,8 +4424,8 @@ multiplying the old size with that factor. Default is 1.5. :rehash-threshold THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0. -Resize the hash table when ratio of the number of entries in the -table. Default is 0.8. +Resize the hash table when the ratio (number of entries / table size) +is greater or equal than THRESHOLD. Default is 0.8. :weakness WEAK -- WEAK must be one of nil, t, `key', `value', `key-or-value', or `key-and-value'. If WEAK is not nil, the table @@ -4549,7 +4548,7 @@ DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0, doc: /* Return the size of TABLE. The size can be used as an argument to `make-hash-table' to create -a hash table than can hold as many elements of TABLE holds +a hash table than can hold as many elements as TABLE holds without need for resizing. */) (Lisp_Object table) { === modified file 'src/minibuf.c' --- src/minibuf.c 2010-07-29 05:48:06 +0000 +++ src/minibuf.c 2010-08-08 21:12:29 +0000 @@ -2080,7 +2080,8 @@ staticpro (&Qread_expression_history); DEFVAR_LISP ("read-buffer-function", &Vread_buffer_function, - doc: /* If this is non-nil, `read-buffer' does its work by calling this function. */); + doc: /* If this is non-nil, `read-buffer' does its work by calling this function. +The function is called with the arguments passed to `read-buffer'. */); Vread_buffer_function = Qnil; DEFVAR_BOOL ("read-buffer-completion-ignore-case", === modified file 'src/w32fns.c' --- src/w32fns.c 2010-07-24 20:52:43 +0000 +++ src/w32fns.c 2010-08-08 21:12:29 +0000 @@ -7053,7 +7053,7 @@ DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, doc: /* Maximum size for tooltips. -Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); +Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, === modified file 'src/xfns.c' --- src/xfns.c 2010-08-08 21:03:45 +0000 +++ src/xfns.c 2010-08-08 21:15:44 +0000 @@ -1003,7 +1003,7 @@ if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0) FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f); - + if (cursor != x->text_cursor && x->text_cursor != 0) XFreeCursor (dpy, x->text_cursor); @@ -5598,7 +5598,7 @@ font_param = Ffont_get (font, intern (":name")); if (STRINGP (font_param)) default_name = xstrdup (SDATA (font_param)); - else + else { font_param = Fframe_parameter (frame, Qfont_param); if (STRINGP (font_param)) @@ -5609,7 +5609,7 @@ default_name = xstrdup (x_last_font_name); /* Convert fontconfig names to Gtk names, i.e. remove - before number */ - if (default_name) + if (default_name) { char *p = strrchr (default_name, '-'); if (p) @@ -5870,8 +5870,8 @@ Vx_cursor_fore_pixel = Qnil; DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, - doc: /* Maximum size for tooltips. Value is a pair (COLUMNS . ROWS). -Text larger than this is clipped. */); + doc: /* Maximum size for tooltips. +Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, ------------------------------------------------------------ revno: 101025 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2010-08-08 14:03:45 -0700 message: Use const char* instead of char*. * src/xterm.c (x_create_toolkit_scroll_bar): * src/xfont.c (xfont_list_pattern): * src/xfns.c (x_default_scroll_bar_color_parameter) (xic_create_fontsetname, x_default_font_parameter) (x_screen_planes): * src/xdisp.c (c_string_pos, number_of_chars, reseat_to_string) (store_mode_line_string, decode_mode_spec, display_string): * src/menu.c (digest_single_submenu): * src/keymap.h (initial_define_key, initial_define_lispy_key): * src/keymap.c (initial_define_key, initial_define_lispy_key): * src/image.c (image_error, image_keyword): * src/gtkutil.h (xg_create_widget, xg_create_scroll_bar): * src/gtkutil.c (xg_create_widget, xg_create_scroll_bar): * src/ftfont.c (struct fc_charset_table, ftfont_spec_pattern) (ftfont_list, ftfont_match): * src/frame.c (frame_parm_table): * src/font.h (font_intern_prop, font_parse_xlfd, font_parse_fcname) (font_unparse_fcname, font_unparse_fcname, font_open_by_name) (font_add_log, font_deferred_log): * src/font.c (font_intern_prop, font_parse_xlfd, font_parse_fcname) (font_unparse_fcname, font_unparse_fcname, font_open_by_name) (font_add_log, font_deferred_log): * src/emacs.c (argmatch): * src/dispextern.h (struct it): * src/coding.c (ENCODE_DESIGNATION): * src/charset.c (define_charset_internal): Use const. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-08 20:26:12 +0000 +++ src/ChangeLog 2010-08-08 21:03:45 +0000 @@ -1,5 +1,33 @@ 2010-08-08 Dan Nicolaescu + Use const char* instead of char*. + * xterm.c (x_create_toolkit_scroll_bar): + * xfont.c (xfont_list_pattern): + * xfns.c (x_default_scroll_bar_color_parameter) + (xic_create_fontsetname, x_default_font_parameter) + (x_screen_planes): + * xdisp.c (c_string_pos, number_of_chars, reseat_to_string) + (store_mode_line_string, decode_mode_spec, display_string): + * menu.c (digest_single_submenu): + * keymap.h (initial_define_key, initial_define_lispy_key): + * keymap.c (initial_define_key, initial_define_lispy_key): + * image.c (image_error, image_keyword): + * gtkutil.h (xg_create_widget, xg_create_scroll_bar): + * gtkutil.c (xg_create_widget, xg_create_scroll_bar): + * ftfont.c (struct fc_charset_table, ftfont_spec_pattern) + (ftfont_list, ftfont_match): + * frame.c (frame_parm_table): + * font.h (font_intern_prop, font_parse_xlfd, font_parse_fcname) + (font_unparse_fcname, font_unparse_fcname, font_open_by_name) + (font_add_log, font_deferred_log): + * font.c (font_intern_prop, font_parse_xlfd, font_parse_fcname) + (font_unparse_fcname, font_unparse_fcname, font_open_by_name) + (font_add_log, font_deferred_log): + * emacs.c (argmatch): + * dispextern.h (struct it): + * coding.c (ENCODE_DESIGNATION): + * charset.c (define_charset_internal): Use const. + * s/freebsd.h (DECLARE_GETPWUID_WITH_UID_T): Remove, unused. * xrdb.c: Remove include guard. Remove === modified file 'src/charset.c' --- src/charset.c 2010-07-29 05:48:06 +0000 +++ src/charset.c 2010-08-08 21:03:45 +0000 @@ -1265,7 +1265,7 @@ static int define_charset_internal (Lisp_Object name, int dimension, - unsigned char *code_space, + const unsigned char *code_space, unsigned min_code, unsigned max_code, int iso_final, int iso_revision, int emacs_mule_id, int ascii_compatible, int supplementary, === modified file 'src/coding.c' --- src/coding.c 2010-07-29 05:48:06 +0000 +++ src/coding.c 2010-08-08 21:03:45 +0000 @@ -4097,8 +4097,8 @@ #define ENCODE_DESIGNATION(charset, reg, coding) \ do { \ unsigned char final_char = CHARSET_ISO_FINAL (charset); \ - char *intermediate_char_94 = "()*+"; \ - char *intermediate_char_96 = ",-./"; \ + const char *intermediate_char_94 = "()*+"; \ + const char *intermediate_char_96 = ",-./"; \ int revision = -1; \ int c; \ \ === modified file 'src/dispextern.h' --- src/dispextern.h 2010-08-07 01:10:12 +0000 +++ src/dispextern.h 2010-08-08 21:03:45 +0000 @@ -2050,7 +2050,7 @@ /* C string to iterate over. Non-null means get characters from this string, otherwise characters are read from current_buffer or it->string. */ - unsigned char *s; + const unsigned char *s; /* Number of characters in the string (s, or it->string) we iterate over. */ === modified file 'src/emacs.c' --- src/emacs.c 2010-08-06 18:48:24 +0000 +++ src/emacs.c 2010-08-08 21:03:45 +0000 @@ -629,7 +629,7 @@ enough information to do it right. */ static int -argmatch (char **argv, int argc, char *sstr, char *lstr, int minlen, char **valptr, int *skipptr) +argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr) { char *p = NULL; int arglen; === modified file 'src/font.c' --- src/font.c 2010-08-05 23:34:12 +0000 +++ src/font.c 2010-08-08 21:03:45 +0000 @@ -232,7 +232,7 @@ STR. */ Lisp_Object -font_intern_prop (char *str, int len, int force_symbol) +font_intern_prop (const char *str, int len, int force_symbol) { int i; Lisp_Object tem; @@ -981,7 +981,7 @@ a fully specified XLFD. */ int -font_parse_xlfd (char *name, Lisp_Object font) +font_parse_xlfd (const char *name, Lisp_Object font) { int len = strlen (name); int i, j, n; @@ -1306,7 +1306,7 @@ This function tries to guess which format it is. */ int -font_parse_fcname (char *name, Lisp_Object font) +font_parse_fcname (const char *name, Lisp_Object font) { char *p, *q; char *size_beg = NULL, *size_end = NULL; @@ -1563,7 +1563,7 @@ FONT_SIZE_INDEX of FONT is 0, use PIXEL_SIZE instead. */ int -font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes) +font_unparse_fcname (Lisp_Object font, int pixel_size, const char *name, int nbytes) { Lisp_Object family, foundry; Lisp_Object tail, val; @@ -1571,7 +1571,7 @@ int i, len = 1; char *p; Lisp_Object styles[3]; - char *style_names[3] = { "weight", "slant", "width" }; + const char *style_names[3] = { "weight", "slant", "width" }; char work[256]; family = AREF (font, FONT_FAMILY_INDEX); @@ -3506,7 +3506,7 @@ found, return Qnil. */ Lisp_Object -font_open_by_name (FRAME_PTR f, char *name) +font_open_by_name (FRAME_PTR f, const char *name) { Lisp_Object args[2]; Lisp_Object spec, ret; @@ -5060,7 +5060,7 @@ opening), ARG is the argument for the action, and RESULT is the result of the action. */ void -font_add_log (char *action, Lisp_Object arg, Lisp_Object result) +font_add_log (const char *action, Lisp_Object arg, Lisp_Object result) { Lisp_Object tail, val; int i; @@ -5146,7 +5146,7 @@ as font_add_log. */ void -font_deferred_log (char *action, Lisp_Object arg, Lisp_Object result) +font_deferred_log (const char *action, Lisp_Object arg, Lisp_Object result) { if (EQ (Vfont_log, Qt)) return; === modified file 'src/font.h' --- src/font.h 2010-08-05 23:15:24 +0000 +++ src/font.h 2010-08-08 21:03:45 +0000 @@ -783,10 +783,10 @@ extern void font_done_for_face (FRAME_PTR f, struct face *face); extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec); -extern Lisp_Object font_open_by_name (FRAME_PTR f, char *name); +extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name); extern void font_close_object (FRAME_PTR f, Lisp_Object font_object); -extern Lisp_Object font_intern_prop (char *str, int len, int force_symbol); +extern Lisp_Object font_intern_prop (const char *str, int len, int force_symbol); extern void font_update_sort_order (int *order); extern void font_parse_family_registry (Lisp_Object family, @@ -795,12 +795,12 @@ extern Lisp_Object font_spec_from_family_registry (Lisp_Object family, Lisp_Object registry); -extern int font_parse_xlfd (char *name, Lisp_Object font); +extern int font_parse_xlfd (const char *name, Lisp_Object font); extern int font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int bytes); -extern int font_parse_fcname (char *name, Lisp_Object font); +extern int font_parse_fcname (const char *name, Lisp_Object font); extern int font_unparse_fcname (Lisp_Object font, int pixel_size, - char *name, int bytes); + const char *name, int bytes); extern int font_unparse_gtkname (Lisp_Object, struct frame *, char *, int); extern void register_font_driver (struct font_driver *driver, FRAME_PTR f); extern void free_font_driver_list (FRAME_PTR f); @@ -856,8 +856,8 @@ extern Lisp_Object QCfoundry, QCadstyle, QCregistry; extern Lisp_Object Vfont_log; -extern void font_add_log (char *, Lisp_Object, Lisp_Object); -extern void font_deferred_log (char *, Lisp_Object, Lisp_Object); +extern void font_add_log (const char *, Lisp_Object, Lisp_Object); +extern void font_deferred_log (const char *, Lisp_Object, Lisp_Object); #define FONT_ADD_LOG(ACTION, ARG, RESULT) \ do { \ === modified file 'src/frame.c' --- src/frame.c 2010-08-06 19:01:35 +0000 +++ src/frame.c 2010-08-08 21:03:45 +0000 @@ -2770,7 +2770,7 @@ that is an index in this table. */ struct frame_parm_table { - char *name; + const char *name; Lisp_Object *variable; }; === modified file 'src/ftfont.c' --- src/ftfont.c 2010-08-05 23:34:12 +0000 +++ src/ftfont.c 2010-08-08 21:03:45 +0000 @@ -96,11 +96,11 @@ static struct { /* registry name */ - char *name; + const char *name; /* characters to distinguish the charset from the others */ int uniquifier[6]; /* additional constraint by language */ - char *lang; + const char *lang; /* set on demand */ FcCharSet *fc_charset; } fc_charset_table[] = @@ -691,12 +691,8 @@ return spec; } -static FcPattern *ftfont_spec_pattern (Lisp_Object, char *, - struct OpenTypeSpec **, - char **langname); - static FcPattern * -ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **otspec, char **langname) +ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **otspec, const char **langname) { Lisp_Object tmp, extra; FcPattern *pattern = NULL; @@ -866,7 +862,7 @@ char otlayout[15]; /* For "otlayout:XXXX" */ struct OpenTypeSpec *otspec = NULL; int spacing = -1; - char *langname = NULL; + const char *langname = NULL; if (! fc_initialized) { @@ -1057,7 +1053,7 @@ FcResult result; char otlayout[15]; /* For "otlayout:XXXX" */ struct OpenTypeSpec *otspec = NULL; - char *langname = NULL; + const char *langname = NULL; if (! fc_initialized) { @@ -2630,7 +2626,7 @@ if (strcmp (ftfont_booleans[i], keystr) == 0) { - char *str = SYMBOLP (val) ? SDATA (SYMBOL_NAME (val)) : NULL; + const char *str = SYMBOLP (val) ? SDATA (SYMBOL_NAME (val)) : NULL; if (INTEGERP (val)) str = XINT (val) != 0 ? "true" : "false"; if (str == NULL) str = "true"; === modified file 'src/gtkutil.c' --- src/gtkutil.c 2010-08-06 19:07:16 +0000 +++ src/gtkutil.c 2010-08-08 21:03:45 +0000 @@ -2370,7 +2370,7 @@ Returns the widget created. */ GtkWidget * -xg_create_widget (char *type, char *name, FRAME_PTR f, widget_value *val, +xg_create_widget (const char *type, const char *name, FRAME_PTR f, widget_value *val, GCallback select_cb, GCallback deactivate_cb, GCallback highlight_cb) { @@ -3233,7 +3233,7 @@ struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, - char *scroll_bar_name) + const char *scroll_bar_name) { GtkWidget *wscroll; GtkWidget *webox; === modified file 'src/gtkutil.h' --- src/gtkutil.h 2010-08-01 13:57:07 +0000 +++ src/gtkutil.h 2010-08-08 21:03:45 +0000 @@ -135,8 +135,8 @@ extern char *xg_get_font_name (FRAME_PTR f, char *); -extern GtkWidget *xg_create_widget (char *type, - char *name, +extern GtkWidget *xg_create_widget (const char *type, + const char *name, FRAME_PTR f, widget_value *val, GCallback select_cb, @@ -163,7 +163,7 @@ struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, - char *scroll_bar_name); + const char *scroll_bar_name); extern void xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id); extern void xg_update_scrollbar_pos (FRAME_PTR f, === modified file 'src/image.c' --- src/image.c 2010-08-06 19:07:16 +0000 +++ src/image.c 2010-08-08 21:03:45 +0000 @@ -598,7 +598,7 @@ static Lisp_Object define_image_type (struct image_type *type, int loaded); static struct image_type *lookup_image_type (Lisp_Object symbol); -static void image_error (char *format, Lisp_Object, Lisp_Object); +static void image_error (const char *format, Lisp_Object, Lisp_Object); static void x_laplace (struct frame *, struct image *); static void x_emboss (struct frame *, struct image *); static int x_build_heuristic_mask (struct frame *, struct image *, @@ -699,7 +699,7 @@ therefore simply displays a message. */ static void -image_error (char *format, Lisp_Object arg1, Lisp_Object arg2) +image_error (const char *format, Lisp_Object arg1, Lisp_Object arg2) { add_to_log (format, arg1, arg2); } @@ -731,7 +731,7 @@ struct image_keyword { /* Name of keyword. */ - char *name; + const char *name; /* The type of value allowed. */ enum image_value_type type; === modified file 'src/keymap.c' --- src/keymap.c 2010-08-05 23:34:12 +0000 +++ src/keymap.c 2010-08-08 21:03:45 +0000 @@ -174,13 +174,13 @@ initial_define_key (control_x_map, Ctl('X'), "exchange-point-and-mark"); */ void -initial_define_key (Lisp_Object keymap, int key, char *defname) +initial_define_key (Lisp_Object keymap, int key, const char *defname) { store_in_keymap (keymap, make_number (key), intern_c_string (defname)); } void -initial_define_lispy_key (Lisp_Object keymap, char *keyname, char *defname) +initial_define_lispy_key (Lisp_Object keymap, const char *keyname, const char *defname) { store_in_keymap (keymap, intern_c_string (keyname), intern_c_string (defname)); } === modified file 'src/keymap.h' --- src/keymap.h 2010-08-05 23:15:24 +0000 +++ src/keymap.h 2010-08-08 21:03:45 +0000 @@ -45,8 +45,8 @@ extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object, char *, int, int, int, int); extern int current_minor_maps (Lisp_Object **, Lisp_Object **); -extern void initial_define_key (Lisp_Object, int, char *); -extern void initial_define_lispy_key (Lisp_Object, char *, char *); +extern void initial_define_key (Lisp_Object, int, const char *); +extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); extern void syms_of_keymap (void); extern void keys_of_keymap (void); === modified file 'src/menu.c' --- src/menu.c 2010-08-05 23:34:12 +0000 +++ src/menu.c 2010-08-08 21:03:45 +0000 @@ -662,7 +662,7 @@ { /* Create a new pane. */ Lisp_Object pane_name, prefix; - char *pane_string; + const char *pane_string; panes_seen++; === modified file 'src/xdisp.c' --- src/xdisp.c 2010-08-08 16:23:11 +0000 +++ src/xdisp.c 2010-08-08 21:03:45 +0000 @@ -430,7 +430,7 @@ Lisp_Object Qrect, Qcircle, Qpoly; /* Tool bar styles */ -Lisp_Object Qtext, Qboth, Qboth_horiz, Qtext_image_horiz; +Lisp_Object Qboth, Qboth_horiz, Qtext_image_horiz; /* Non-zero means print newline to stdout before next mini-buffer message. */ @@ -992,12 +992,12 @@ static int display_mode_lines (struct window *); static int display_mode_line (struct window *, enum face_id, Lisp_Object); static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_Object, int); -static int store_mode_line_string (char *, Lisp_Object, int, int, int, Lisp_Object); -static char *decode_mode_spec (struct window *, int, int, int, - Lisp_Object *); +static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object); +static const char *decode_mode_spec (struct window *, int, int, int, + Lisp_Object *); static void display_menu_bar (struct window *); static int display_count_lines (int, int, int, int, int *); -static int display_string (unsigned char *, Lisp_Object, Lisp_Object, +static int display_string (const unsigned char *, Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT, struct it *, int, int, int, int); static void compute_line_metrics (struct it *); static void run_redisplay_end_trigger_hook (struct it *); @@ -1020,7 +1020,7 @@ static void load_overlay_strings (struct it *, int); static int init_from_display_pos (struct it *, struct window *, struct display_pos *); -static void reseat_to_string (struct it *, unsigned char *, +static void reseat_to_string (struct it *, const unsigned char *, Lisp_Object, int, int, int, int); static enum move_it_result move_it_in_display_line_to (struct it *, EMACS_INT, int, @@ -1035,8 +1035,8 @@ static struct text_pos string_pos_nchars_ahead (struct text_pos, Lisp_Object, int); static struct text_pos string_pos (int, Lisp_Object); -static struct text_pos c_string_pos (int, unsigned char *, int); -static int number_of_chars (unsigned char *, int); +static struct text_pos c_string_pos (int, const unsigned char *, int); +static int number_of_chars (const unsigned char *, int); static void compute_stop_pos (struct it *); static void compute_string_pos (struct text_pos *, struct text_pos, Lisp_Object); @@ -1548,7 +1548,7 @@ means recognize multibyte characters. */ static struct text_pos -c_string_pos (int charpos, unsigned char *s, int multibyte_p) +c_string_pos (int charpos, const unsigned char *s, int multibyte_p) { struct text_pos pos; @@ -1580,7 +1580,7 @@ non-zero means recognize multibyte characters. */ static int -number_of_chars (unsigned char *s, int multibyte_p) +number_of_chars (const unsigned char *s, int multibyte_p) { int nchars; @@ -5581,7 +5581,7 @@ calling this function. */ static void -reseat_to_string (struct it *it, unsigned char *s, Lisp_Object string, +reseat_to_string (struct it *it, const unsigned char *s, Lisp_Object string, int charpos, int precision, int field_width, int multibyte) { /* No region in strings. */ @@ -18538,7 +18538,7 @@ { int multibyte; int bytepos, charpos; - unsigned char *spec; + const unsigned char *spec; Lisp_Object string; bytepos = percent_position; @@ -18808,7 +18808,7 @@ */ static int -store_mode_line_string (char *string, Lisp_Object lisp_string, int copy_string, +store_mode_line_string (const char *string, Lisp_Object lisp_string, int copy_string, int field_width, int precision, Lisp_Object props) { int len; @@ -19224,7 +19224,7 @@ static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------"; -static char * +static const char * decode_mode_spec (struct window *w, register int c, int field_width, int precision, Lisp_Object *string) { @@ -19784,7 +19784,7 @@ Value is the number of columns displayed. */ static int -display_string (unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string, +display_string (const unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string, EMACS_INT face_string_pos, EMACS_INT start, struct it *it, int field_width, int precision, int max_x, int multibyte) { === modified file 'src/xfns.c' --- src/xfns.c 2010-08-06 18:41:15 +0000 +++ src/xfns.c 2010-08-08 21:03:45 +0000 @@ -501,7 +501,7 @@ static Lisp_Object x_default_scroll_bar_color_parameter (struct frame *, Lisp_Object, Lisp_Object, - char *, char *, + const char *, const char *, int); @@ -1767,7 +1767,7 @@ static Lisp_Object x_default_scroll_bar_color_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop, - char *xprop, char *xclass, + const char *xprop, const char *xclass, int foreground_p) { struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); @@ -2138,7 +2138,7 @@ } if (! xfs) { - char *last_resort = "-*-*-*-r-normal--*-*-*-*-*-*"; + const char *last_resort = "-*-*-*-r-normal--*-*-*-*-*-*"; missing_list = NULL; xfs = XCreateFontSet (FRAME_X_DISPLAY (f), last_resort, @@ -3011,7 +3011,7 @@ if (! FONTP (font) && ! STRINGP (font)) { - char *names[] + const char *names[] = { #ifdef HAVE_XFT /* This will find the normal Xft font. */ @@ -3740,7 +3740,7 @@ (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); - char *vendor = ServerVendor (dpyinfo->display); + const char *vendor = ServerVendor (dpyinfo->display); if (! vendor) vendor = ""; return build_string (vendor); @@ -3934,7 +3934,7 @@ static struct visual_class { - char *name; + const char *name; int class; } visual_classes[] = === modified file 'src/xfont.c' --- src/xfont.c 2010-08-05 23:34:12 +0000 +++ src/xfont.c 2010-08-08 21:03:45 +0000 @@ -334,7 +334,7 @@ } static Lisp_Object -xfont_list_pattern (Display *display, char *pattern, +xfont_list_pattern (Display *display, const char *pattern, Lisp_Object registry, Lisp_Object script) { Lisp_Object list = Qnil; === modified file 'src/xterm.c' --- src/xterm.c 2010-08-06 19:07:16 +0000 +++ src/xterm.c 2010-08-08 21:03:45 +0000 @@ -22,11 +22,7 @@ /* Xt features made by Fred Pierresteguy. */ #include - -/* On 4.3 these lose if they come after xterm.h. */ -/* Putting these at the beginning seems to be standard for other .c files. */ #include - #include #include @@ -107,11 +103,6 @@ #include "../lwlib/xlwmenu.h" #endif -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) - -extern void free_frame_menubar (struct frame *); -#endif - #ifdef USE_X_TOOLKIT #if !defined(NO_EDITRES) #define HACK_EDITRES @@ -4380,7 +4371,7 @@ static void x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) { - char *scroll_bar_name = SCROLL_BAR_NAME; + const char *scroll_bar_name = SCROLL_BAR_NAME; BLOCK_INPUT; xg_create_scroll_bar (f, bar, G_CALLBACK (xg_scroll_callback), ------------------------------------------------------------ revno: 101024 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2010-08-08 13:26:12 -0700 message: * src/s/freebsd.h (DECLARE_GETPWUID_WITH_UID_T): Remove, unused. diff: === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2010-07-29 03:25:08 +0000 +++ admin/CPP-DEFINES 2010-08-08 20:26:12 +0000 @@ -100,7 +100,6 @@ DATA_SEG_BITS DATA_START DBL_MIN_REPLACEMENT -DECLARE_GETPWUID_WITH_UID_T DEFAULT_SOUND_DEVICE DEVICE_SEP DIRECTORY_SEP === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-08 20:16:48 +0000 +++ src/ChangeLog 2010-08-08 20:26:12 +0000 @@ -1,5 +1,7 @@ 2010-08-08 Dan Nicolaescu + * s/freebsd.h (DECLARE_GETPWUID_WITH_UID_T): Remove, unused. + * xrdb.c: Remove include guard. Remove DECLARE_GETPWUID_WITH_UID_T conditional it had no effect. Remove #if 0 code. Replace malloc->xmalloc, free->xfree, === modified file 'src/s/freebsd.h' --- src/s/freebsd.h 2010-06-30 02:48:54 +0000 +++ src/s/freebsd.h 2010-08-08 20:26:12 +0000 @@ -28,7 +28,6 @@ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) #define HAVE_GETLOADAVG 1 -#define DECLARE_GETPWUID_WITH_UID_T /* This silences a few compilation warnings. */ #undef BSD_SYSTEM ------------------------------------------------------------ revno: 101023 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2010-08-08 13:16:48 -0700 message: Cleanup xrdb.c. * src/xrdb.c: Remove include guard. Remove DECLARE_GETPWUID_WITH_UID_T conditional it had no effect. Remove #if 0 code. Replace malloc->xmalloc, free->xfree, realloc->xrealloc instead of using #defines. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-08 16:43:26 +0000 +++ src/ChangeLog 2010-08-08 20:16:48 +0000 @@ -1,3 +1,10 @@ +2010-08-08 Dan Nicolaescu + + * xrdb.c: Remove include guard. Remove + DECLARE_GETPWUID_WITH_UID_T conditional it had no effect. + Remove #if 0 code. Replace malloc->xmalloc, free->xfree, + realloc->xrealloc instead of using #defines. + 2010-08-08 Eli Zaretskii * cmds.c (Fforward_line, Fbeginning_of_line, Fend_of_line): === modified file 'src/xrdb.c' --- src/xrdb.c 2010-07-29 05:48:06 +0000 +++ src/xrdb.c 2010-08-08 20:16:48 +0000 @@ -20,9 +20,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -#ifdef emacs #include -#endif #ifdef HAVE_UNISTD_H #include @@ -52,36 +50,11 @@ extern char *getenv (const char *); -/* This does cause trouble on AIX. I'm going to take the comment at - face value. */ -#if 0 -extern short getuid (); /* If this causes portability problems, - I think we should just delete it; it'll - default to `int' anyway. */ -#endif - -#ifdef DECLARE_GETPWUID_WITH_UID_T -extern struct passwd *getpwuid (uid_t); -extern struct passwd *getpwnam (const char *); -#else -extern struct passwd *getpwuid (uid_t); -extern struct passwd *getpwnam (const char *); -#endif +extern struct passwd *getpwuid (uid_t); +extern struct passwd *getpwnam (const char *); extern char *get_system_name (void); -/* Make sure not to #include anything after these definitions. Let's - not step on anyone's prototypes. */ -#ifdef emacs -/* darwin.h may have already defined these. */ -#undef malloc -#undef realloc -#undef free -#define malloc xmalloc -#define realloc xrealloc -#define free xfree -#endif - char *x_get_string_resource (XrmDatabase rdb, const char *name, const char *class); static int file_p (const char *filename); @@ -114,7 +87,7 @@ if (result) { - char *copy = (char *) malloc (strlen (result) + 1); + char *copy = (char *) xmalloc (strlen (result) + 1); strcpy (copy, result); return copy; } @@ -159,7 +132,7 @@ char *lang = getenv ("LANG"); int path_size = 100; - char *path = (char *) malloc (path_size); + char *path = (char *) xmalloc (path_size); int path_len = 0; const char *p = string; @@ -210,7 +183,7 @@ case 'l': if (! lang) { - free (path); + xfree (path); return NULL; } @@ -220,7 +193,7 @@ case 't': case 'c': - free (path); + xfree (path); return NULL; } } @@ -231,7 +204,7 @@ if (path_len + next_len + 1 > path_size) { path_size = (path_len + next_len + 1) * 2; - path = (char *) realloc (path, path_size); + path = (char *) xrealloc (path, path_size); } memcpy (path + path_len, next, next_len); @@ -257,7 +230,7 @@ if (path_len + suffix_len + 1 > path_size) { path_size = (path_len + suffix_len + 1); - path = (char *) realloc (path, path_size); + path = (char *) xrealloc (path, path_size); } memcpy (path + path_len, suffix, suffix_len); @@ -268,7 +241,7 @@ if (! file_p (path)) { - free (path); + xfree (path); return NULL; } @@ -298,7 +271,7 @@ if (ptr == NULL) return xstrdup ("/"); - copy = (char *) malloc (strlen (ptr) + 2); + copy = (char *) xmalloc (strlen (ptr) + 2); strcpy (copy, ptr); strcat (copy, "/"); @@ -370,7 +343,7 @@ if (path) { db = XrmGetFileDatabase (path); - free (path); + xfree (path); } return db; @@ -409,12 +382,12 @@ || (file = search_magic_path (free_it, class, "%N", 0))))) { XrmDatabase db = XrmGetFileDatabase (file); - free (file); - free (free_it); + xfree (file); + xfree (free_it); return db; } - free (free_it); + xfree (free_it); return NULL; } @@ -439,12 +412,12 @@ char *xdefault; home = gethomedir (); - xdefault = (char *) malloc (strlen (home) + sizeof (".Xdefaults")); + xdefault = (char *) xmalloc (strlen (home) + sizeof (".Xdefaults")); strcpy (xdefault, home); strcat (xdefault, ".Xdefaults"); db = XrmGetFileDatabase (xdefault); - free (home); - free (xdefault); + xfree (home); + xfree (xdefault); } #ifdef HAVE_XSCREENRESOURCESTRING @@ -471,7 +444,7 @@ { home = gethomedir (); host = get_system_name (); - path = (char *) malloc (strlen (home) + path = (char *) xmalloc (strlen (home) + sizeof (".Xdefaults-") + strlen (host)); sprintf (path, "%s%s%s", home, ".Xdefaults-", host); @@ -480,8 +453,8 @@ db = XrmGetFileDatabase (p); - free (path); - free (home); + xfree (path); + xfree (home); return db; } @@ -586,7 +559,7 @@ /* Figure out what the "customization string" is, so we can use it to decode paths. */ - free (x_customization_string); + xfree (x_customization_string); x_customization_string = x_get_customization_string (user_database, myname, myclass); ------------------------------------------------------------ revno: 101022 committer: Ulf Jasper branch nick: trunk timestamp: Sun 2010-08-08 19:42:47 +0200 message: Fixed bug#6766 (icalendar.el) lisp/ChangeLog: * calendar/icalendar.el (icalendar-uid-format): Doc fix. (icalendar--split-value): Fixed splitting regexp. (Bug#6766) (icalendar--get-weekday-numbers): New (icalendar--create-uid, icalendar-export-region) (icalendar--parse-summary-and-rest): Code formatting. (icalendar--convert-recurring-to-diary): Handle multiple byday values in weekly rules. (Bug#6766) test/ChangeLog: * icalendar-testsuite.el (icalendar-testsuite-run): Added internal tests. (icalendar-testsuite--trim, icalendar-testsuite--compare-strings) (icalendar-testsuite--run-internal-tests): New. (icalendar-testsuite--test-convert-ordinary-to-ical) (icalendar-testsuite--test-convert-block-to-ical) (icalendar-testsuite--test-convert-anniversary-to-ical) (icalendar-testsuite--test-parse-vtimezone) (icalendar-testsuite--do-test-export): Code formatting. (icalendar-testsuite--test-parse-vtimezone): Doc fix. (icalendar-testsuite--do-test-import) (icalendar-testsuite--do-test-cycle): Use icalendar-testsuite--compare-strings (icalendar-testsuite--run-import-tests): Comment added. (icalendar-testsuite--run-import-tests) (icalendar-testsuite--run-real-world-tests): Fixed expected results. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-08 03:04:57 +0000 +++ lisp/ChangeLog 2010-08-08 17:42:47 +0000 @@ -1,3 +1,13 @@ +2010-08-08 Ulf Jasper + + * calendar/icalendar.el (icalendar-uid-format): Doc fix. + (icalendar--split-value): Fixed splitting regexp. (Bug#6766) + (icalendar--get-weekday-numbers): New + (icalendar--create-uid, icalendar-export-region) + (icalendar--parse-summary-and-rest): Code formatting. + (icalendar--convert-recurring-to-diary): Handle multiple byday + values in weekly rules. (Bug#6766) + 2010-08-08 Jay Belanger * calc/calc.el (calc-trail-mode,calc-refresh): Use `face' property === modified file 'lisp/calendar/icalendar.el' --- lisp/calendar/icalendar.el 2010-02-28 01:22:44 +0000 +++ lisp/calendar/icalendar.el 2010-08-08 17:42:47 +0000 @@ -212,15 +212,15 @@ (defcustom icalendar-uid-format "emacs%t%c" - "Format of unique ID code (UID) for each iCalendar object. -The following specifiers are available: + "Format of unique ID code (UID) for each iCalendar object. +The following specifiers are available: %c COUNTER, an integer value that is increased each time a uid is - generated. This may be necessary for systems which do not + generated. This may be necessary for systems which do not provide time-resolution finer than a second. %h HASH, a hash value of the diary entry, %s DTSTART, the start date (excluding time) of the diary entry, %t TIMESTAMP, a unique creation timestamp, -%u USERNAME, the user-login-name. +%u USERNAME, the variable `user-login-name'. For example, a value of \"%s_%h@mydomain.com\" will generate a UID code for each entry composed of the time of the event, a hash @@ -427,7 +427,7 @@ (goto-char (point-min)) (while (re-search-forward - "\\([A-Za-z0-9-]+\\)=\\(\\([^;,:]+\\)\\|\"\\([^\"]+\\)\"\\);?" + "\\([A-Za-z0-9-]+\\)=\\(\\([^;:]+\\)\\|\"\\([^\"]+\\)\"\\);?" nil t) (setq param-name (intern (match-string 1))) (setq param-value (match-string 2)) @@ -744,6 +744,20 @@ ;; Error: -1)) +(defun icalendar--get-weekday-numbers (abbrevweekdays) + "Return the list of numbers for the comma-separated ABBREVWEEKDAYS." + (when abbrevweekdays + (let* ((num -1) + (weekday-alist (mapcar (lambda (day) + (progn + (setq num (1+ num)) + (cons (downcase day) num))) + icalendar--weekday-array))) + (delq nil + (mapcar (lambda (abbrevday) + (cdr (assoc abbrevday weekday-alist))) + (split-string (downcase abbrevweekdays) ",")))))) + (defun icalendar--get-weekday-abbrev (weekday) "Return the abbreviated WEEKDAY." (catch 'found @@ -912,21 +926,21 @@ `icalendar--uid-count'. Returns the UID string." (let ((uid icalendar-uid-format)) - (setq uid (replace-regexp-in-string - "%c" + (setq uid (replace-regexp-in-string + "%c" (format "%d" icalendar--uid-count) uid t t)) (setq icalendar--uid-count (1+ icalendar--uid-count)) - (setq uid (replace-regexp-in-string + (setq uid (replace-regexp-in-string "%t" (format "%d%d%d" (car (current-time)) (cadr (current-time)) - (car (cddr (current-time)))) + (car (cddr (current-time)))) uid t t)) - (setq uid (replace-regexp-in-string - "%h" + (setq uid (replace-regexp-in-string + "%h" (format "%d" (abs (sxhash entry-full))) uid t t)) - (setq uid (replace-regexp-in-string + (setq uid (replace-regexp-in-string "%u" (or user-login-name "UNKNOWN_USER") uid t t)) (let ((dtstart (if (string-match "^DTSTART[^:]*:\\([0-9]*\\)" contents) (substring contents (match-beginning 1) (match-end 1)) @@ -1008,7 +1022,7 @@ (if url (setq contents (concat contents "\nURL:" url)))) - (setq header (concat "\nBEGIN:VEVENT\nUID:" + (setq header (concat "\nBEGIN:VEVENT\nUID:" (icalendar--create-uid entry-full contents))) (setq result (concat result header contents "\nEND:VEVENT"))) ;; handle errors @@ -1126,7 +1140,7 @@ (list "%u" (concat "\\(" icalendar-import-format-url "\\)??")))) ;; Need the \' regexp in order to detect multi-line items - (setq s (concat "\\`" + (setq s (concat "\\`" (icalendar--rris "%s" "\\(.*?\\)" s nil t) "\\'")) (if (string-match s summary-and-rest) @@ -2057,39 +2071,47 @@ )) ) (cond ((string-equal frequency "WEEKLY") - (if (not start-t) - (progn - ;; weekly and all-day - (icalendar--dmsg "weekly all-day") - (if until - (setq result - (format - (concat "%%%%(and " - "(diary-cyclic %d %s) " - "(diary-block %s %s))") - (* interval 7) - dtstart-conv - dtstart-conv - (if count until-1-conv until-conv) - )) - (setq result - (format "%%%%(and (diary-cyclic %d %s))" - (* interval 7) - dtstart-conv)))) - ;; weekly and not all-day - (let* ((byday (cadr (assoc 'BYDAY rrule-props))) - (weekday - (icalendar--get-weekday-number byday))) + (let* ((byday (cadr (assoc 'BYDAY rrule-props))) + (weekdays + (icalendar--get-weekday-numbers byday)) + (weekday-clause + (when (> (length weekdays) 1) + (format "(memq (calendar-day-of-week date) '%s) " + weekdays)))) + (if (not start-t) + (progn + ;; weekly and all-day + (icalendar--dmsg "weekly all-day") + (if until + (setq result + (format + (concat "%%%%(and " + "%s" + "(diary-block %s %s))") + (or weekday-clause + (format "(diary-cyclic %d %s) " + (* interval 7) + dtstart-conv)) + (if count until-1-conv until-conv) + )) + (setq result + (format "%%%%(and %s(diary-cyclic %d %s))" + (or weekday-clause "") + (if weekday-clause 1 (* interval 7)) + dtstart-conv)))) + ;; weekly and not all-day (icalendar--dmsg "weekly not-all-day") (if until (setq result (format (concat "%%%%(and " - "(diary-cyclic %d %s) " + "%s" "(diary-block %s %s)) " "%s%s%s") - (* interval 7) - dtstart-conv + (or weekday-clause + (format "(diary-cyclic %d %s) " + (* interval 7) + dtstart-conv)) dtstart-conv until-conv (or start-t "") @@ -2100,10 +2122,11 @@ ;; DTEND;VALUE=DATE-TIME:20030919T113000 (setq result (format - "%%%%(and (diary-cyclic %s %s)) %s%s%s" - (* interval 7) - dtstart-conv - (or start-t "") + "%%%%(and %s(diary-cyclic %d %s)) %s%s%s" + (or weekday-clause "") + (if weekday-clause 1 (* interval 7)) + dtstart-conv + (or start-t "") (if end-t "-" "") (or end-t ""))))))) ;; yearly ((string-equal frequency "YEARLY") === modified file 'test/ChangeLog' --- test/ChangeLog 2010-06-25 00:33:25 +0000 +++ test/ChangeLog 2010-08-08 17:42:47 +0000 @@ -1,3 +1,20 @@ +2010-08-08 Ulf Jasper + + * icalendar-testsuite.el (icalendar-testsuite-run): Added internal tests. + (icalendar-testsuite--trim, icalendar-testsuite--compare-strings) + (icalendar-testsuite--run-internal-tests): New. + (icalendar-testsuite--test-convert-ordinary-to-ical) + (icalendar-testsuite--test-convert-block-to-ical) + (icalendar-testsuite--test-convert-anniversary-to-ical) + (icalendar-testsuite--test-parse-vtimezone) + (icalendar-testsuite--do-test-export): Code formatting. + (icalendar-testsuite--test-parse-vtimezone): Doc fix. + (icalendar-testsuite--do-test-import) + (icalendar-testsuite--do-test-cycle): Use icalendar-testsuite--compare-strings + (icalendar-testsuite--run-import-tests): Comment added. + (icalendar-testsuite--run-import-tests) + (icalendar-testsuite--run-real-world-tests): Fixed expected results. + 2010-06-25 Chong Yidong * redisplay-testsuite.el (test-redisplay-3): New test. === modified file 'test/icalendar-testsuite.el' --- test/icalendar-testsuite.el 2010-02-19 18:59:00 +0000 +++ test/icalendar-testsuite.el 2010-08-08 17:42:47 +0000 @@ -33,6 +33,7 @@ (defun icalendar-testsuite-run () "Run icalendar test suite." (interactive) + (icalendar-testsuite--run-internal-tests) (icalendar-testsuite--run-function-tests) (icalendar-testsuite--run-import-tests) (icalendar-testsuite--run-export-tests) @@ -41,6 +42,44 @@ (message "All icalendar tests finished successfully.")) ;; ====================================================================== +;; internal +;; ====================================================================== +(defun icalendar-testsuite--trim (string) + "Remove leading and trailing whitespace from STRING." + (replace-regexp-in-string "[ \t\n]+\\'" "" + (replace-regexp-in-string "\\`[ \t\n]+" "" string))) + +(defun icalendar-testsuite--compare-strings (str1 str2) + "Compare strings STR1 and STR2. +Return t if strings are equal, else return substring indicating first difference. +FIXME: make this a little smarter." + (let* ((s1 (icalendar-testsuite--trim str1)) + (s2 (icalendar-testsuite--trim str2)) + (result (compare-strings s1 0 nil s2 0 nil)) + (len (length str2))) + (if (numberp result) + (if (> result 0) + (concat "..." (substring str2 (- result 1) + (min len (+ (- result 1) 3))) "...") + (concat "..." (substring str2 (- (+ result 1)) + (min len (+ (- (+ result 1)) 3))) "...")) + t))) + +(defun icalendar-testsuite--run-internal-tests () + "Run icalendar-testsuite internal tests." + (assert (equal t (icalendar-testsuite--compare-strings " abcde" "abcde "))) + (assert + (string= "...def..." + (icalendar-testsuite--compare-strings "abcxe" "abcdefghijklmn"))) + (assert (string= "...xe..." + (icalendar-testsuite--compare-strings "abcde" "abcxe"))) + (assert (string= "...ddd..." + (icalendar-testsuite--compare-strings "abc" "abcdddddd"))) + (assert (string= "......" + (icalendar-testsuite--compare-strings "abcdefghij" "abc")))) + + +;; ====================================================================== ;; Test methods for functions ;; ====================================================================== (defun icalendar-testsuite--run-function-tests () @@ -260,7 +299,7 @@ (assert (string= "subject" (cadr result))) ;; with time - (setq result (icalendar--convert-ordinary-to-ical + (setq result (icalendar--convert-ordinary-to-ical "&?" "&2010 2 15 12:34-23:45 s")) (assert (= 2 (length result))) (assert (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400" @@ -269,7 +308,7 @@ (assert (string= "s" (cadr result))) ;; with time, again -- test bug#5549 - (setq result (icalendar--convert-ordinary-to-ical + (setq result (icalendar--convert-ordinary-to-ical "x?" "x2010 2 15 0:34-1:45 s")) (assert (= 2 (length result))) (assert (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T003400" @@ -312,7 +351,7 @@ "Test method for `icalendar--convert-block-to-ical'." (let* ((calendar-date-style 'iso) result) - (setq result (icalendar--convert-block-to-ical + (setq result (icalendar--convert-block-to-ical "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien")) (assert (= 2 (length result))) (assert (string= (concat @@ -325,7 +364,7 @@ "Test method for `icalendar--convert-cyclic-to-ical'." (let* ((calendar-date-style 'iso) result) - (setq result (icalendar--convert-block-to-ical + (setq result (icalendar--convert-block-to-ical "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien")) (assert (= 2 (length result))) (assert (string= (concat @@ -338,7 +377,7 @@ "Test method for `icalendar--convert-anniversary-to-ical'." (let* ((calendar-date-style 'iso) result) - (setq result (icalendar--convert-anniversary-to-ical + (setq result (icalendar--convert-anniversary-to-ical "" "%%(diary-anniversary 1964 6 30) g")) (assert (= 2 (length result))) (assert (string= (concat @@ -386,6 +425,7 @@ )) (defun icalendar-testsuite--test-parse-vtimezone () + "Test method for `icalendar--parse-vtimezone'." (let (vtimezone result) (setq vtimezone (icalendar-testsuite--get-ical-event "BEGIN:VTIMEZONE TZID:thename @@ -406,7 +446,8 @@ (setq result (icalendar--parse-vtimezone vtimezone)) (assert (string= "thename" (car result))) (message (cdr result)) - (assert (string= "STD-02:00DST-03:00,M3.5.0/03:00:00,M10.5.0/04:00:00" (cdr result))) + (assert (string= "STD-02:00DST-03:00,M3.5.0/03:00:00,M10.5.0/04:00:00" + (cdr result))) (setq vtimezone (icalendar-testsuite--get-ical-event "BEGIN:VTIMEZONE TZID:anothername BEGIN:STANDARD @@ -457,7 +498,7 @@ (icalendar-testsuite--do-test-export input-iso expected-output))) (when input-european (let ((calendar-month-name-array - ["Januar" "Februar" "Mrz" "April" "Mai" "Juni" "Juli" "August" + ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August" "September" "Oktober" "November" "Dezember"]) (calendar-day-name-array ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag" @@ -511,12 +552,18 @@ \\s-*$" nil t))) (error - "Export test failed! Input: `%s'\nFound:\n\n%s\n\nbut expected\n\n%s" + "Export test failed! Input: `%s'\nFound:\n\n%s\n\nbut expected\n\n%s\n%s" input (or (and (match-beginning 1) - (buffer-substring-no-properties (match-beginning 1) (match-end 1))) - "") - (or expected-output "")))) + (buffer-substring-no-properties (match-beginning 1) + (match-end 1))) + "") + (or expected-output "") + (icalendar-testsuite--compare-strings (or (and (match-beginning 1) + (buffer-substring-no-properties (match-beginning 1) + (match-end 1))) + "") + (or expected-output ""))))) (kill-buffer (find-buffer-visiting temp-file)) (delete-file temp-file))) @@ -571,11 +618,13 @@ (icalendar-import-buffer temp-file t t) (save-excursion (find-file temp-file) - (let ((result (buffer-substring-no-properties (point-min) (point-max)))) - (unless (string-match (concat "^\\s-*" expected-output "\\s-*$") - result) - (error "Import test failed! Found `%s'\nbut expected `%s'" result - expected-output))) + (let* ((result (buffer-substring-no-properties (point-min) (point-max))) + (difference + (icalendar-testsuite--compare-strings result + expected-output))) + (if (stringp difference) + (error "Import test failed! Found\n`%s'\nbut expected\n`%s'\n%s'" + result expected-output difference))) (kill-buffer (find-buffer-visiting temp-file)) (delete-file temp-file)))) @@ -626,9 +675,12 @@ (when (re-search-forward "\nUID:.*\n" nil t) (replace-match "\n")) (let ((cycled (buffer-substring-no-properties (point-min) (point-max)))) - (unless (string-equal org-input cycled) - (error "Import test failed! Found `%s'\nbut expected `%s'" cycled - org-input)))) + (let ((difference (icalendar-testsuite--compare-strings cycled + org-input))) + (if (stringp difference) + (error "Import test failed! Found\n`%s'\nbut expected\n`%s'\n%s'" + cycled org-input difference))) + )) ;; clean up -- Note this is done only if test is passed (kill-buffer (find-buffer-visiting temp-diary)) @@ -660,6 +712,7 @@ "&9/19/2003 non-recurring allday") (icalendar-testsuite--test-import + ;; do not remove the trailing blank after "long"! "SUMMARY:long summary DTSTART;VALUE=DATE:20030919" @@ -678,9 +731,17 @@ DTEND;VALUE=DATE:20040828 DTSTAMP:20031103T011641Z " - "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien" - "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien" - "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien") + "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien + Status: TENTATIVE + Class: PRIVATE +" + "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien + Status: TENTATIVE + Class: PRIVATE +" + "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien + Status: TENTATIVE + Class: PRIVATE") (icalendar-testsuite--test-import "UID @@ -702,9 +763,15 @@ LAST-MODIFIED :20041118T013640Z " - "&2004/11/23 14:00-14:30 folded summary" - "&23/11/2004 14:00-14:30 folded summary" - "&11/23/2004 14:00-14:30 folded summary") + "&2004/11/23 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE" + "&23/11/2004 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE" + "&11/23/2004 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE") (icalendar-testsuite--test-import "UID :6161a312-3902-11d9-b512-f764153bb28b @@ -723,9 +790,15 @@ DTSTAMP :20041118T013641Z " - "&2004/11/23 14:45-15:45 another example" - "&23/11/2004 14:45-15:45 another example" - "&11/23/2004 14:45-15:45 another example") + "&2004/11/23 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE" + "&23/11/2004 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE" + "&11/23/2004 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE") (icalendar-testsuite--test-import "SUMMARY:rrule daily @@ -890,10 +963,55 @@ SEQUENCE:1 CREATED:20041127T183329 " - "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub" - "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub" - "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub") - ) + "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub + Class: PUBLIC" + "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub + Class: PUBLIC" + "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub + Class: PUBLIC") + + ;;bug#6766 -- multiple byday values in a weekly rrule + (icalendar-testsuite--test-import +"CLASS:PUBLIC +DTEND;TZID=America/New_York:20100421T120000 +DTSTAMP:20100525T141214Z +DTSTART;TZID=America/New_York:20100421T113000 +RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR +SEQUENCE:1 +STATUS:CONFIRMED +SUMMARY:Scrum +TRANSP:OPAQUE +UID:8814e3f9-7482-408f-996c-3bfe486a1262 +END:VEVENT +BEGIN:VEVENT +CLASS:PUBLIC +DTSTAMP:20100525T141214Z +DTSTART;VALUE=DATE:20100422 +DTEND;VALUE=DATE:20100423 +RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH +SEQUENCE:1 +SUMMARY:Tues + Thurs thinking +TRANSP:OPAQUE +UID:8814e3f9-7482-408f-996c-3bfe486a1263 +" +"&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking + Class: PUBLIC" + +"&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking + Class: PUBLIC" + +"&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking + Class: PUBLIC") +) ;; ====================================================================== ;; Export tests @@ -1104,11 +1222,13 @@ "&9/5/2003 10:30-15:30 On-Site Interview Desc: 10:30am - Blah Location: Cccc - Organizer: MAILTO:aaaaaaa@aaaaaaa.com" + Organizer: MAILTO:aaaaaaa@aaaaaaa.com + Status: CONFIRMED" "&5/9/2003 10:30-15:30 On-Site Interview Desc: 10:30am - Blah Location: Cccc - Organizer: MAILTO:aaaaaaa@aaaaaaa.com") + Organizer: MAILTO:aaaaaaa@aaaaaaa.com + Status: CONFIRMED") ;; 2003-06-18 a (icalendar-testsuite--test-import @@ -1146,11 +1266,13 @@ "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX Desc: 753 Zeichen hier radiert Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) - Organizer: MAILTO:xxx@xxxxx.com" + Organizer: MAILTO:xxx@xxxxx.com + Status: CONFIRMED" "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX Desc: 753 Zeichen hier radiert Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) - Organizer: MAILTO:xxx@xxxxx.com") + Organizer: MAILTO:xxx@xxxxx.com + Status: CONFIRMED") ;; 2003-06-18 b -- uses timezone (icalendar-testsuite--test-import @@ -1188,7 +1310,7 @@ \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below) DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000 -DESCRIPTION:Viele Zeichen standen hier frher +DESCRIPTION:Viele Zeichen standen hier früher SEQUENCE:0 PRIORITY:5 CLASS: @@ -1211,12 +1333,12 @@ END:VCALENDAR" nil "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 - Desc: Viele Zeichen standen hier frher + Desc: Viele Zeichen standen hier früher Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) Organizer: MAILTO:bbb@bbbbb.com Status: CONFIRMED" "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 - Desc: Viele Zeichen standen hier frher + Desc: Viele Zeichen standen hier früher Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) Organizer: MAILTO:bbb@bbbbb.com Status: CONFIRMED") @@ -1661,9 +1783,13 @@ :20050128T011209Z" nil "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day - Desc: abcdef" + Desc: abcdef + Status: CONFIRMED + Class: PRIVATE" "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day - Desc: abcdef") + Desc: abcdef + Status: CONFIRMED + Class: PRIVATE") ;; 2005-03-01 lt (icalendar-testsuite--test-import ------------------------------------------------------------ revno: 101021 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2010-08-08 19:51:56 +0300 message: Fix overlay arrow display, make doc strings bidi-friendly. xdisp.c (display_line): Move the handling of overlay arrow after the call to find_row_edges. (Bug#6699) cmds.c (Fforward_line, Fbeginning_of_line, Fend_of_line): editfns.c (Fline_beginning_position, Fline_end_position): State in the doc strings that start and end of line are in the logical order. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-07 20:26:55 +0000 +++ src/ChangeLog 2010-08-08 16:43:26 +0000 @@ -1,3 +1,13 @@ +2010-08-08 Eli Zaretskii + + * cmds.c (Fforward_line, Fbeginning_of_line, Fend_of_line): + * editfns.c (Fline_beginning_position, Fline_end_position): State + in the doc strings that start and end of line are in the logical + order. + + * xdisp.c (display_line): Move the handling of overlay arrow after + the call to find_row_edges. (Bug#6699) + 2010-08-07 Chong Yidong * keyboard.c (command_loop_1): === modified file 'src/cmds.c' --- src/cmds.c 2010-07-29 05:48:06 +0000 +++ src/cmds.c 2010-08-08 16:43:26 +0000 @@ -113,7 +113,8 @@ DEFUN ("forward-line", Fforward_line, Sforward_line, 0, 1, "^p", doc: /* Move N lines forward (backward if N is negative). -Precisely, if point is on line I, move to the start of line I + N. +Precisely, if point is on line I, move to the start of line I + N +\("start of line" in the logical order). If there isn't room, go as far as possible (no error). Returns the count of lines left to move. If moving forward, that is N - number of lines moved; if backward, N + number moved. @@ -157,7 +158,7 @@ } DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, 0, 1, "^p", - doc: /* Move point to beginning of current line. + doc: /* Move point to beginning of current line (in the logical order). With argument N not nil or 1, move forward N - 1 lines first. If point reaches the beginning or end of buffer, it stops there. @@ -181,7 +182,7 @@ } DEFUN ("end-of-line", Fend_of_line, Send_of_line, 0, 1, "^p", - doc: /* Move point to end of current line. + doc: /* Move point to end of current line (in the logical order). With argument N not nil or 1, move forward N - 1 lines first. If point reaches the beginning or end of buffer, it stops there. To ignore intangibility, bind `inhibit-point-motion-hooks' to t. === modified file 'src/editfns.c' --- src/editfns.c 2010-08-05 23:34:12 +0000 +++ src/editfns.c 2010-08-08 16:43:26 +0000 @@ -805,6 +805,9 @@ With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. +The returned position is of the first character in the logical order, +i.e. the one that has the smallest character position. + This function constrains the returned position to the current field unless that would be on a different line than the original, unconstrained result. If N is nil or 1, and a front-sticky field @@ -843,6 +846,9 @@ With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. +The returned position is of the last character in the logical order, +i.e. the character whose buffer position is the largest one. + This function constrains the returned position to the current field unless that would be on a different line than the original, unconstrained result. If N is nil or 1, and a rear-sticky field ends === modified file 'src/xdisp.c' --- src/xdisp.c 2010-08-06 19:07:16 +0000 +++ src/xdisp.c 2010-08-08 16:23:11 +0000 @@ -11352,6 +11352,8 @@ && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val))) { if (FRAME_WINDOW_P (it->f) + /* FIXME: if ROW->reversed_p is set, this should test + the right fringe, not the left one. */ && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0) { #ifdef HAVE_WINDOW_SYSTEM @@ -17798,6 +17800,26 @@ row->truncated_on_left_p = 1; } + /* Remember the position at which this line ends. + + BIDI Note: any code that needs MATRIX_ROW_START/END_CHARPOS + cannot be before the call to find_row_edges below, since that is + where these positions are determined. */ + row->end = it->current; + if (!it->bidi_p) + { + row->minpos = row->start.pos; + row->maxpos = row->end.pos; + } + else + { + /* ROW->minpos and ROW->maxpos must be the smallest and + `1 + the largest' buffer positions in ROW. But if ROW was + bidi-reordered, these two positions can be anywhere in the + row, so we must determine them now. */ + find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos); + } + /* If the start of this line is the overlay arrow-position, then mark this glyph row as the one containing the overlay arrow. This is clearly a mess with variable size fonts. It would be @@ -17843,22 +17865,6 @@ /* Compute pixel dimensions of this line. */ compute_line_metrics (it); - /* Remember the position at which this line ends. */ - row->end = it->current; - if (!it->bidi_p) - { - row->minpos = row->start.pos; - row->maxpos = row->end.pos; - } - else - { - /* ROW->minpos and ROW->maxpos must be the smallest and - `1 + the largest' buffer positions in ROW. But if ROW was - bidi-reordered, these two positions can be anywhere in the - row, so we must determine them now. */ - find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos); - } - /* Record whether this row ends inside an ellipsis. */ row->ends_in_ellipsis_p = (it->method == GET_FROM_DISPLAY_VECTOR ------------------------------------------------------------ revno: 101020 committer: Jay Belanger branch nick: trunk timestamp: Sat 2010-08-07 22:04:57 -0500 message: calc.el (calc-trail-mode,calc-refresh): Use `face' property to italicize headers. (calc-highlight-selections-with-faces): New variable. (calc-selected-face, calc-nonselected-face): New faces. calccomp.el (math-comp-highlight-string): Use `calc-highlight-selections-with-faces' to determine how to highlight subformulas. calc-sel.el (calc-show-selections): Change message to something appropriate. calc.texi (Making Selections, Selecting Subformulas) (Customizing Calc): Mention how to use faces to emphasize selected subformulas. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-08-05 13:51:21 +0000 +++ doc/misc/ChangeLog 2010-08-08 03:04:57 +0000 @@ -1,3 +1,9 @@ +2010-08-08 Jay Belanger + + * calc.texi (Making Selections, Selecting Subformulas) + (Customizing Calc): Mention how to use faces to emphasize selected + sub-formulas. + 2010-08-05 Michael Albinus * tramp.texi (External packages): File attributes cache flushing === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2010-07-10 18:52:53 +0000 +++ doc/misc/calc.texi 2010-08-08 03:04:57 +0000 @@ -21513,7 +21513,11 @@ @noindent Every character not part of the sub-formula @samp{b} has been changed -to a dot. The @samp{*} next to the line number is to remind you that +to a dot. (If the customizable variable +@code{calc-highlight-selections-with-faces} is non-nil, then the characters +not part of the sub-formula are de-emphasized by using a less +noticeable face instead of using dots. @pxref{Displaying Selections}.) +The @samp{*} next to the line number is to remind you that the formula has a portion of it selected. (In this case, it's very obvious, but it might not always be. If Embedded mode is enabled, the word @samp{Sel} also appears in the mode line because the stack @@ -21726,6 +21730,9 @@ @noindent @kindex j d @pindex calc-show-selections +@vindex calc-highlight-selections-with-faces +@vindex calc-selected-face +@vindex calc-nonselected-face The @kbd{j d} (@code{calc-show-selections}) command controls how selected sub-formulas are displayed. One of the alternatives is illustrated in the above examples; if we press @kbd{j d} we switch @@ -21740,6 +21747,13 @@ . . . . 2 x + 1 @end group @end smallexample +If the customizable variable +@code{calc-highlight-selections-with-faces} is non-nil, then the +non-selected portion of the formula will be de-emphasized by using a +less noticeable face (@code{calc-nonselected-face}) instead of dots +and the selected sub-formula will be highlighted by using a more +noticeable face (@code{calc-selected-face}) instead of @samp{#} +signs. (@pxref{Customizing Calc}.) @node Operating on Selections, Rearranging with Selections, Displaying Selections, Selecting Subformulas @subsection Operating on Selections @@ -34911,7 +34925,7 @@ Calc is controlled by many variables, most of which can be reset from within Calc. Some variables are less involved with actual -calculation, and can be set outside of Calc using Emacs's +calculation and can be set outside of Calc using Emacs's customization facilities. These variables are listed below. Typing @kbd{M-x customize-variable RET @var{variable-name} RET} will bring up a buffer in which the variable's value can be redefined. @@ -35197,6 +35211,22 @@ and @code{calc-embedded-open-close-plain-alist}. @end defvar +@defvar calc-highlight-selections-with-faces +@defvarx calc-selected-face +@defvarx calc-nonselected-face +The variable @code{calc-highlight-selections-with-faces} +determines how selected sub-formulas are distinguished. +If @code{calc-highlight-selections-with-faces} is nil, then +a selected sub-formula is distinguished either by changing every +character not part of the sub-formula with a dot or by changing every +character in the sub-formula with a @samp{#} sign. +If @code{calc-highlight-selections-with-faces} is t, +then a selected sub-formula is distinguished either by displaying the +non-selected portion of the formula with @code{calc-nonselected-face} +or by displaying the selected sub-formula with +@code{calc-nonselected-face}. (@pxref{Displaying Selections}.) +@end defvar + @defvar calc-multiplication-has-precedence The variable @code{calc-multiplication-has-precedence} determines whether multiplication has precedence over division in algebraic === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-07 23:57:07 +0000 +++ lisp/ChangeLog 2010-08-08 03:04:57 +0000 @@ -1,3 +1,17 @@ +2010-08-08 Jay Belanger + + * calc/calc.el (calc-trail-mode,calc-refresh): Use `face' property + to italicize headers. + (calc-highlight-selections-with-faces): New variable. + (calc-selected-face, calc-nonselected-face): New faces. + + * calc/calccomp.el (math-comp-highlight-string): Use + `calc-highlight-selections-with-faces' to determine how to highlight + sub-formulas. + + * calc/calc-sel.el (calc-show-selections): Change message to when + using faces to highlight selections. + 2010-08-07 Michael R. Mauger * progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added === modified file 'lisp/calc/calc-sel.el' --- lisp/calc/calc-sel.el 2010-01-13 08:35:10 +0000 +++ lisp/calc/calc-sel.el 2010-08-08 03:04:57 +0000 @@ -309,6 +309,8 @@ (setq n (1+ n)))) (calc-clear-command-flag 'position-point))) +(defvar calc-highlight-selections-with-faces) + (defun calc-show-selections (arg) (interactive "P") (calc-wrapper @@ -330,8 +332,12 @@ (setcar (nthcdr 2 calc-selection-cache-entry) nil) (calc-change-current-selection sel))))) (message (if calc-show-selections - "Displaying only selected part of formulas" - "Displaying all but selected part of formulas")))) + (if calc-highlight-selections-with-faces + "De-emphasizing all but selected part of formulas" + "Displaying only selected part of formulas") + (if calc-highlight-selections-with-faces + "Emphasizing selected part of formulas" + "Displaying all but selected part of formulas"))))) ;; The variables calc-final-point-line and calc-final-point-column ;; are declared in calc.el, and are used throughout. === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2010-06-22 07:41:10 +0000 +++ lisp/calc/calc.el 2010-08-08 03:04:57 +0000 @@ -425,6 +425,27 @@ :group 'calc :type 'integer) +(defcustom calc-highlight-selections-with-faces + nil + "If non-nil, use a separate face to indicate selected sub-formulas. +If `calc-show-selections' is non-nil, then selected sub-formulas are shown +by displaying the rest of the formula in `calc-nonselected-face'. +If `calc-show-selections' is nil, then selected sub-formulas are shown +by displaying the sub-formula in `calc-selected-face'." + :group 'calc + :type 'boolean) + +(defface calc-nonselected-face + '((t :inherit shadow + :slant italic)) + "Face used to show the non-selected portion of a formula." + :group 'calc) + +(defface calc-selected-face + '((t :weight bold)) + "Face used to show the selected portion of a formula." + :group 'calc) + (defvar calc-bug-address "jay.p.belanger@gmail.com" "Address of the maintainer of Calc, for use by `report-calc-bug'.") @@ -1385,8 +1406,7 @@ (set (make-local-variable 'calc-main-buffer) buf)) (when (= (buffer-size) 0) (let ((buffer-read-only nil)) - (insert (propertize (concat "Emacs Calculator Trail\n") - 'font-lock-face 'italic)))) + (insert (propertize "Emacs Calculator Trail\n" 'face 'italic)))) (run-mode-hooks 'calc-trail-mode-hook)) (defun calc-create-buffer () @@ -1976,7 +1996,7 @@ (erase-buffer) (when calc-show-banner (insert (propertize "--- Emacs Calculator Mode ---\n" - 'font-lock-face 'italic))) + 'face 'italic))) (while thing (goto-char (point-min)) (when calc-show-banner === modified file 'lisp/calc/calccomp.el' --- lisp/calc/calccomp.el 2010-06-22 07:41:10 +0000 +++ lisp/calc/calccomp.el 2010-08-08 03:04:57 +0000 @@ -1339,12 +1339,15 @@ (defun math-comp-highlight-string (s) (setq s (copy-sequence s)) - (let ((i (length s))) - (while (>= (setq i (1- i)) 0) - (or (memq (aref s i) '(32 ?\n)) - (aset s i (if calc-show-selections ?\. ?\#))))) - s) - + (if calc-highlight-selections-with-faces + (if (not calc-show-selections) + (propertize s 'face 'calc-selected-face) + (propertize s 'face 'calc-nonselected-face)) + (let ((i (length s))) + (while (>= (setq i (1- i)) 0) + (or (memq (aref s i) '(32 ?\n)) + (aset s i (if calc-show-selections ?\. ?\#))))) + s)) ;; The variable math-comp-sel-tag is local to calc-find-selected-part ;; in calc-sel.el, but is used by math-comp-sel-flat-term and ------------------------------------------------------------ revno: 101019 committer: Michael Mauger branch nick: trunk timestamp: Sat 2010-08-07 19:57:07 -0400 message: * progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added SQLite 3 keywords, functions and datatypes. (sql-interactive-mode): Removed `comint-process-echoes' set to t (Bug#6686). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-07 19:39:04 +0000 +++ lisp/ChangeLog 2010-08-07 23:57:07 +0000 @@ -1,3 +1,10 @@ +2010-08-07 Michael R. Mauger + + * progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added + SQLite 3 keywords, functions and datatypes. + (sql-interactive-mode): Removed `comint-process-echoes' set to t + (Bug#6686). + 2010-08-07 Chong Yidong * simple.el (select-active-regions): Move to keyboard.c. === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2010-07-23 00:59:43 +0000 +++ lisp/progmodes/sql.el 2010-08-07 23:57:07 +0000 @@ -1961,7 +1961,51 @@ function `regexp-opt'. Therefore, take a look at the source before you define your own `sql-mode-mysql-font-lock-keywords'.") -(defvar sql-mode-sqlite-font-lock-keywords nil +(defvar sql-mode-sqlite-font-lock-keywords + (eval-when-compile + (list + ;; SQLite Keyword + (sql-font-lock-keywords-builder 'font-lock-keyword-face nil +"abort" "action" "add" "after" "all" "alter" "analyze" "and" "as" +"asc" "attach" "autoincrement" "before" "begin" "between" "by" +"cascade" "case" "cast" "check" "collate" "column" "commit" "conflict" +"constraint" "create" "cross" "current_date" "current_time" +"current_timestamp" "database" "default" "deferrable" "deferred" +"delete" "desc" "detach" "distinct" "drop" "each" "else" "end" +"escape" "except" "exclusive" "exists" "explain" "fail" "for" +"foreign" "from" "full" "glob" "group" "having" "if" "ignore" +"immediate" "in" "index" "indexed" "initially" "inner" "insert" +"instead" "intersect" "into" "is" "isnull" "join" "key" "left" "like" +"limit" "match" "natural" "no" "not" "notnull" "null" "of" "offset" +"on" "or" "order" "outer" "plan" "pragma" "primary" "query" "raise" +"references" "regexp" "reindex" "release" "rename" "replace" +"restrict" "right" "rollback" "row" "savepoint" "select" "set" "table" +"temp" "temporary" "then" "to" "transaction" "trigger" "union" +"unique" "update" "using" "vacuum" "values" "view" "virtual" "when" +"where" +) + ;; SQLite Data types + (sql-font-lock-keywords-builder 'font-lock-type-face nil +"int" "integer" "tinyint" "smallint" "mediumint" "bigint" "unsigned" +"big" "int2" "int8" "character" "varchar" "varying" "nchar" "native " +"nvarchar" "text" "clob" "blob" "real" "double" "precision" "float" +"numeric" "decimal" "boolean" "date" "datetime" +) + ;; SQLite Functions + (sql-font-lock-keywords-builder 'font-lock-builtin-face nil +;; Core functions +"abs" "changes" "coalesce" "glob" "ifnull" "hex" "last_insert_rowid" +"length" "like" "load_extension" "lower" "ltrim" "max" "min" "nullif" +"quote" "random" "randomblob" "replace" "round" "rtrim" "soundex" +"sqlite_compileoption_get" "sqlite_compileoption_used" +"sqlite_source_id" "sqlite_version" "substr" "total_changes" "trim" +"typeof" "upper" "zeroblob" +;; Date/time functions +"time" "julianday" "strftime" +;; Aggregate functions +"avg" "count" "group_concat" "max" "min" "sum" "total" +))) + "SQLite SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -2951,7 +2995,6 @@ (sql-get-product-feature sql-product :prompt-length)) (make-local-variable 'sql-input-ring-separator) (make-local-variable 'sql-input-ring-file-name) - (setq comint-process-echoes t) ;; Run the mode hook (along with comint's hooks). (run-mode-hooks 'sql-interactive-mode-hook) ;; Set comint based on user overrides. ------------------------------------------------------------ revno: 101018 committer: Chong Yidong branch nick: trunk timestamp: Sat 2010-08-07 16:26:55 -0400 message: Avoid restrictions when copying window selection. * src/keyboard.c (command_loop_1): * src/insdel.c (prepare_to_modify_buffer): Don't call validate_region. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-07 19:39:04 +0000 +++ src/ChangeLog 2010-08-07 20:26:55 +0000 @@ -1,5 +1,10 @@ 2010-08-07 Chong Yidong + * keyboard.c (command_loop_1): + * insdel.c (prepare_to_modify_buffer): Don't call validate_region. + +2010-08-07 Chong Yidong + * insdel.c (prepare_to_modify_buffer): Save active region text to Vsaved_region_selection. === modified file 'src/insdel.c' --- src/insdel.c 2010-08-07 19:39:04 +0000 +++ src/insdel.c 2010-08-07 20:26:55 +0000 @@ -2055,13 +2055,12 @@ && !NILP (Vtransient_mark_mode) && NILP (Vsaved_region_selection)) { - Lisp_Object b = Fmarker_position (current_buffer->mark); - Lisp_Object e = make_number (PT); - if (NILP (Fequal (b, e))) - { - validate_region (&b, &e); - Vsaved_region_selection = make_buffer_string (XINT (b), XINT (e), 0); - } + int b = XINT (Fmarker_position (current_buffer->mark)); + int e = XINT (make_number (PT)); + if (b < e) + Vsaved_region_selection = make_buffer_string (b, e, 0); + else if (b > e) + Vsaved_region_selection = make_buffer_string (e, b, 0); } signal_before_change (start, end, preserve_ptr); === modified file 'src/keyboard.c' --- src/keyboard.c 2010-08-07 19:39:04 +0000 +++ src/keyboard.c 2010-08-07 20:26:55 +0000 @@ -1797,11 +1797,14 @@ { /* Set window selection. If `select-active-regions' is `lazy', only do it for temporarily active regions. */ - Lisp_Object beg = Fmarker_position (current_buffer->mark); - Lisp_Object end = make_number (PT); - validate_region (&beg, &end); - call2 (Qx_set_selection, QPRIMARY, - make_buffer_string (XINT (beg), XINT (end), 0)); + int beg = XINT (Fmarker_position (current_buffer->mark)); + int end = XINT (make_number (PT)); + if (beg < end) + call2 (Qx_set_selection, QPRIMARY, + make_buffer_string (beg, end, 0)); + else if (beg > end) + call2 (Qx_set_selection, QPRIMARY, + make_buffer_string (end, beg, 0)); } if (!NILP (Vdeactivate_mark)) ------------------------------------------------------------ revno: 101017 committer: Chong Yidong branch nick: trunk timestamp: Sat 2010-08-07 16:10:30 -0400 message: Fix last change. diff: === modified file 'lisp/simple.el' --- lisp/simple.el 2010-08-07 19:39:04 +0000 +++ lisp/simple.el 2010-08-07 20:10:30 +0000 @@ -3686,7 +3686,8 @@ ((/= (region-beginning) (region-end)) (x-set-selection 'PRIMARY (buffer-substring-no-properties - (point) (mark)))))) + (region-beginning) + (region-end)))))) (if (and (null force) (or (eq transient-mark-mode 'lambda) (and (eq (car-safe transient-mark-mode) 'only) ------------------------------------------------------------ revno: 101016 committer: Chong Yidong branch nick: trunk timestamp: Sat 2010-08-07 15:39:04 -0400 message: Change `select-active-region' mechanics. Save region text prior to buffer modification. Set window selection lazily, during `deactivate-mark' or after each command when the region is temporarily active. * lisp/cus-start.el: Add custom declaration for select-active-regions. * lisp/mouse.el (mouse-drag-track): Remove hacks to deal with old select-active-regions implementation. (mouse-yank-at-click): Doc fix. * lisp/simple.el (select-active-regions): Move to keyboard.c. (deactivate-mark): Used saved-region-selection. (select-active-region): Function removed. (activate-mark, set-mark, push-mark-command) (handle-shift-selection): Don't call it. (keyboard-quit): Avoid adding the region to the window selection. * src/insdel.c (prepare_to_modify_buffer): Save active region text to Vsaved_region_selection. * src/keyboard.c (Vselect_active_regions): Move from simple.el. (Vsaved_region_selection, Qx_set_selection, QPRIMARY, Qlazy): New vars. (command_loop_1): Set window selection prior to deactivating the mark. * src/xselect.c (QPRIMARY): Move to keyboard.c. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-08-07 10:26:42 +0000 +++ etc/NEWS 2010-08-07 19:39:04 +0000 @@ -192,7 +192,10 @@ default, is now similar to other X applications. In particular, kill and yank use the clipboard, in addition to the primary selection. -*** `select-active-regions' now defaults to t. +*** `select-active-regions' now defaults to `lazy'. +This means that any active region made with shift-selection or mouse +dragging, or acted on by Emacs (e.g. with M-w or C-w), is +automatically added to the primary window selection. *** `x-select-enable-clipboard' now defaults to t. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-07 10:11:07 +0000 +++ lisp/ChangeLog 2010-08-07 19:39:04 +0000 @@ -1,3 +1,18 @@ +2010-08-07 Chong Yidong + + * simple.el (select-active-regions): Move to keyboard.c. + (deactivate-mark): Used saved-region-selection. + (select-active-region): Function removed. + (activate-mark, set-mark, push-mark-command) + (handle-shift-selection): Don't call it. + (keyboard-quit): Avoid adding the region to the window selection. + + * mouse.el (mouse-drag-track): Remove hacks to deal with old + select-active-regions implementation. + (mouse-yank-at-click): Doc fix. + + * cus-start.el: Add custom declaration for select-active-regions. + 2010-08-07 Eli Zaretskii * simple.el (delete-forward-char): Doc fix. === modified file 'lisp/cus-start.el' --- lisp/cus-start.el 2010-08-01 13:57:07 +0000 +++ lisp/cus-start.el 2010-08-07 19:39:04 +0000 @@ -197,6 +197,11 @@ (help-char keyboard character) (help-event-list keyboard (repeat (sexp :format "%v"))) (menu-prompting menu boolean) + (select-active-regions killing + (choice (const :tag "lazy" lazy) + (const :tag "always" t) + (const :tag "off" nil)) + "24.1") (suggest-key-bindings keyboard (choice (const :tag "off" nil) (integer :tag "time" 2) (other :tag "on"))) === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-08-01 16:48:15 +0000 +++ lisp/mouse.el 2010-08-07 19:39:04 +0000 @@ -697,9 +697,6 @@ (window-system) (sit-for 1)) (push-mark) - ;; If `select-active-regions' is non-nil, `set-mark' sets the - ;; primary selection to the buffer's region, overriding the role - ;; of `copy-region-as-kill'; that's why we did the copy first. (set-mark (point)) (if (numberp end) (goto-char end)) (mouse-set-region-1))) @@ -905,10 +902,6 @@ `mouse-drag-region'." (mouse-minibuffer-check start-event) (setq mouse-selection-click-count-buffer (current-buffer)) - ;; We must call deactivate-mark before repositioning point. - ;; Otherwise, for `select-active-regions' non-nil, we get the wrong - ;; selection if the user drags a region, clicks elsewhere to - ;; reposition point, then middle-clicks to paste the selection. (deactivate-mark) (let* ((original-window (selected-window)) ;; We've recorded what we needed from the current buffer and @@ -955,10 +948,7 @@ (if (eq transient-mark-mode 'lambda) '(only) (cons 'only transient-mark-mode))) - (let ((range (mouse-start-end start-point start-point click-count)) - ;; Prevent `push-mark' from clobbering the primary selection - ;; if the user clicks without dragging. - (select-active-regions nil)) + (let ((range (mouse-start-end start-point start-point click-count))) (goto-char (nth 0 range)) (push-mark nil t t) (goto-char (nth 1 range))) @@ -1017,23 +1007,16 @@ ;; If point has moved, finish the drag. (let* (last-command this-command) - ;; Copy the region so that `select-active-regions' can - ;; override `copy-region-as-kill'. (and mouse-drag-copy-region do-mouse-drag-region-post-process (let (deactivate-mark) - (copy-region-as-kill (mark) (point)))) - ;; For `select-active-regions' non-nil, ensure that - ;; further alterations of the region (e.g. via - ;; shift-selection) continue to update PRIMARY. - (select-active-region)) + (copy-region-as-kill (mark) (point))))) ;; If point hasn't moved, run the binding of the ;; terminating up-event. (if do-multi-click (goto-char start-point) - (let (select-active-regions) - (deactivate-mark))) + (deactivate-mark)) (when (and (functionp fun) (= start-hscroll (window-hscroll start-window)) ;; Don't run the up-event handler if the window @@ -1251,9 +1234,7 @@ and set mark at the beginning. Prefix arguments are interpreted as with \\[yank]. If `mouse-yank-at-point' is non-nil, insert at point -regardless of where you click. -If `select-active-regions' is non-nil, the mark is deactivated -before inserting the text." +regardless of where you click." (interactive "e\nP") ;; Give temporary modes such as isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) === modified file 'lisp/simple.el' --- lisp/simple.el 2010-08-07 10:11:07 +0000 +++ lisp/simple.el 2010-08-07 19:39:04 +0000 @@ -3666,29 +3666,27 @@ (marker-position (mark-marker)) (signal 'mark-inactive nil))) -(defcustom select-active-regions t - "If non-nil, an active region automatically becomes the window selection." - :type 'boolean - :group 'killing - :version "24.1") - (declare-function x-selection-owner-p "xselect.c" (&optional selection)) -;; Many places set mark-active directly, and several of them failed to also -;; run deactivate-mark-hook. This shorthand should simplify. (defsubst deactivate-mark (&optional force) "Deactivate the mark by setting `mark-active' to nil. Unless FORCE is non-nil, this function does nothing if Transient Mark mode is disabled. This function also runs `deactivate-mark-hook'." (when (or transient-mark-mode force) - ;; Copy the latest region into the primary selection, if desired. - (and select-active-regions - mark-active - (display-selections-p) - (x-selection-owner-p 'PRIMARY) - (x-set-selection 'PRIMARY (buffer-substring-no-properties - (region-beginning) (region-end)))) + (when (and select-active-regions + (region-active-p) + (display-selections-p)) + ;; The var `saved-region-selection', if non-nil, is the text in + ;; the region prior to the last command modifying the buffer. + ;; Set the selection to that, or to the current region. + (cond (saved-region-selection + (x-set-selection 'PRIMARY saved-region-selection) + (setq saved-region-selection nil)) + ((/= (region-beginning) (region-end)) + (x-set-selection 'PRIMARY + (buffer-substring-no-properties + (point) (mark)))))) (if (and (null force) (or (eq transient-mark-mode 'lambda) (and (eq (car-safe transient-mark-mode) 'only) @@ -3706,14 +3704,7 @@ (when (mark t) (setq mark-active t) (unless transient-mark-mode - (setq transient-mark-mode 'lambda)) - (select-active-region))) - -(defsubst select-active-region () - "Set the PRIMARY X selection if `select-active-regions' is non-nil." - (and select-active-regions - (display-selections-p) - (x-set-selection 'PRIMARY (current-buffer)))) + (setq transient-mark-mode 'lambda)))) (defun set-mark (pos) "Set this buffer's mark to POS. Don't use this function! @@ -3736,7 +3727,6 @@ (progn (setq mark-active t) (run-hooks 'activate-mark-hook) - (select-active-region) (set-marker (mark-marker) pos (current-buffer))) ;; Normally we never clear mark-active except in Transient Mark mode. ;; But when we actually clear out the mark value too, we must @@ -3820,7 +3810,6 @@ (push-mark nil nomsg t) (setq mark-active t) (run-hooks 'activate-mark-hook) - (select-active-region) (unless nomsg (message "Mark activated"))))) @@ -4008,11 +3997,8 @@ deactivate it, and restore the variable `transient-mark-mode' to its earlier value." (cond ((and shift-select-mode this-command-keys-shift-translated) - (if (and mark-active - (eq (car-safe transient-mark-mode) 'only)) - ;; Another program may have grabbed the selection; make - ;; sure we get it back now. - (select-active-region) + (unless (and mark-active + (eq (car-safe transient-mark-mode) 'only)) (setq transient-mark-mode (cons 'only (unless (eq transient-mark-mode 'lambda) @@ -5576,7 +5562,10 @@ During execution of Lisp code, this character causes a quit directly. At top-level, as an editor command, this simply beeps." (interactive) - (deactivate-mark) + ;; Avoid adding the region to the window selection. + (setq saved-region-selection nil) + (let (select-active-regions) + (deactivate-mark)) (if (fboundp 'kmacro-keyboard-quit) (kmacro-keyboard-quit)) (setq defining-kbd-macro nil) === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-07 01:10:12 +0000 +++ src/ChangeLog 2010-08-07 19:39:04 +0000 @@ -1,3 +1,16 @@ +2010-08-07 Chong Yidong + + * insdel.c (prepare_to_modify_buffer): Save active region text to + Vsaved_region_selection. + + * xselect.c (QPRIMARY): Move to keyboard.c. + + * keyboard.c (Vselect_active_regions): Move from simple.el. + (Vsaved_region_selection, Qx_set_selection, QPRIMARY, Qlazy): New + vars. + (command_loop_1): Set window selection prior to deactivating the + mark. + 2010-08-07 Juanma Barranquero * alloc.c (lisp_malloc): === modified file 'src/insdel.c' --- src/insdel.c 2010-07-11 09:27:13 +0000 +++ src/insdel.c 2010-08-07 19:39:04 +0000 @@ -74,6 +74,8 @@ Lisp_Object Qinhibit_modification_hooks; +extern Lisp_Object Vselect_active_regions, Vsaved_region_selection; + /* Check all markers in the current buffer, looking for something invalid. */ @@ -2047,6 +2049,21 @@ base_buffer->filename); #endif /* not CLASH_DETECTION */ + /* If `select-active-regions' is non-nil, save the region text. */ + if (!NILP (Vselect_active_regions) + && !NILP (current_buffer->mark_active) + && !NILP (Vtransient_mark_mode) + && NILP (Vsaved_region_selection)) + { + Lisp_Object b = Fmarker_position (current_buffer->mark); + Lisp_Object e = make_number (PT); + if (NILP (Fequal (b, e))) + { + validate_region (&b, &e); + Vsaved_region_selection = make_buffer_string (XINT (b), XINT (e), 0); + } + } + signal_before_change (start, end, preserve_ptr); if (current_buffer->newline_cache) === modified file 'src/keyboard.c' --- src/keyboard.c 2010-08-06 18:41:15 +0000 +++ src/keyboard.c 2010-08-07 19:39:04 +0000 @@ -361,6 +361,15 @@ X Windows wants this for selection ownership. */ unsigned long last_event_timestamp; +/* If non-nil, active regions automatically become the window selection. */ +Lisp_Object Vselect_active_regions; + +/* The text in the active region prior to modifying the buffer. + Used by the `select-active-regions' feature. */ +Lisp_Object Vsaved_region_selection; + +Lisp_Object Qx_set_selection, QPRIMARY, Qlazy; + Lisp_Object Qself_insert_command; Lisp_Object Qforward_char; Lisp_Object Qbackward_char; @@ -1781,11 +1790,26 @@ Vtransient_mark_mode = Qnil; else if (EQ (Vtransient_mark_mode, Qonly)) Vtransient_mark_mode = Qidentity; + else if (EQ (Vselect_active_regions, Qlazy) + ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) + : (!NILP (Vselect_active_regions) + && !NILP (Vtransient_mark_mode))) + { + /* Set window selection. If `select-active-regions' is + `lazy', only do it for temporarily active regions. */ + Lisp_Object beg = Fmarker_position (current_buffer->mark); + Lisp_Object end = make_number (PT); + validate_region (&beg, &end); + call2 (Qx_set_selection, QPRIMARY, + make_buffer_string (XINT (beg), XINT (end), 0)); + } if (!NILP (Vdeactivate_mark)) call0 (Qdeactivate_mark); else if (current_buffer != prev_buffer || MODIFF != prev_modiff) call1 (Vrun_hooks, intern ("activate-mark-hook")); + + Vsaved_region_selection = Qnil; } finalize: @@ -11682,6 +11706,13 @@ Qinput_method_function = intern_c_string ("input-method-function"); staticpro (&Qinput_method_function); + Qx_set_selection = intern_c_string ("x-set-selection"); + staticpro (&Qx_set_selection); + QPRIMARY = intern_c_string ("PRIMARY"); + staticpro (&QPRIMARY); + Qlazy = intern_c_string ("lazy"); + staticpro (&Qlazy); + Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char"); staticpro (&Qinput_method_exit_on_first_char); Qinput_method_use_echo_area = intern_c_string ("input-method-use-echo-area"); @@ -12289,6 +12320,28 @@ and tool-bar buttons. */); Venable_disabled_menus_and_buttons = Qnil; + DEFVAR_LISP ("select-active-regions", + &Vselect_active_regions, + doc: /* If non-nil, an active region automatically becomes the window selection. +This takes effect only when Transient Mark mode is enabled. + +If the value is `lazy', Emacs only sets the window selection during +`deactivate-mark'; unless the region is temporarily active +(e.g. mouse-drags or shift-selection), in which case it sets the +window selection after each command. + +For other non-nil value, Emacs sets the window selection after every +command. */); + Vselect_active_regions = Qlazy; + + DEFVAR_LISP ("saved-region-selection", + &Vsaved_region_selection, + doc: /* Contents of active region prior to buffer modification. +If `select-active-regions' is non-nil, Emacs sets this to the +text in the region before modifying the buffer. The next +`deactivate-mark' call uses this to set the window selection. */); + Vsaved_region_selection = Qnil; + /* Create the initial keyboard. */ initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); init_kboard (initial_kboard); === modified file 'src/xselect.c' --- src/xselect.c 2010-07-31 21:26:56 +0000 +++ src/xselect.c 2010-08-07 19:39:04 +0000 @@ -2916,7 +2916,7 @@ \"*selectionTimeout\" resource. */); x_selection_timeout = 0; - QPRIMARY = intern_c_string ("PRIMARY"); staticpro (&QPRIMARY); + /* QPRIMARY is defined in keyboard.c. */ QSECONDARY = intern_c_string ("SECONDARY"); staticpro (&QSECONDARY); QSTRING = intern_c_string ("STRING"); staticpro (&QSTRING); QINTEGER = intern_c_string ("INTEGER"); staticpro (&QINTEGER); ------------------------------------------------------------ revno: 101015 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-08-07 13:26:42 +0300 message: NEWS: Mention the Hebrew translation of the tutorial. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-08-07 09:50:08 +0000 +++ etc/ChangeLog 2010-08-07 10:26:42 +0000 @@ -1,5 +1,7 @@ 2010-08-07 Eli Zaretskii + * NEWS: Mention the Hebrew translation. + * tutorials/TUTORIAL.he: Don't use acronyms. 2010-08-05 Eli Zaretskii === modified file 'etc/NEWS' --- etc/NEWS 2010-08-06 04:01:00 +0000 +++ etc/NEWS 2010-08-07 10:26:42 +0000 @@ -51,6 +51,11 @@ This is only useful for Emacs developers to debug certain types of bugs. These is not a new feature; only the configure flag is new. +--- +** New translation of the Emacs Tutorial in Hebrew is available +Type `C-u C-h t' to choose it in case your language setup doesn't +automatically select it. + * Startup Changes in Emacs 24.1 ------------------------------------------------------------ revno: 101014 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-08-07 13:11:07 +0300 message: simple.el (delete-forward-char): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-07 09:31:03 +0000 +++ lisp/ChangeLog 2010-08-07 10:11:07 +0000 @@ -1,5 +1,7 @@ 2010-08-07 Eli Zaretskii + * simple.el (delete-forward-char): Doc fix. + * tutorial.el (help-with-tutorial): Hack safe file-local variables after reading the tutorial. === modified file 'lisp/simple.el' --- lisp/simple.el 2010-07-17 20:21:51 +0000 +++ lisp/simple.el 2010-08-07 10:11:07 +0000 @@ -895,7 +895,7 @@ (t (delete-char (- n) killflag)))) (defun delete-forward-char (n &optional killflag) - "Delete the previous N characters (following if N is negative). + "Delete the following N characters (previous if N is negative). If Transient Mark mode is enabled, the mark is active, and N is 1, delete the text in the region and deactivate the mark instead. To disable this, set `delete-active-region' to nil. ------------------------------------------------------------ revno: 101013 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-08-07 12:50:08 +0300 message: Clean up TUTORIAL.he. tutorials/TUTORIAL.he: Don't use acronyms. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-08-05 17:11:32 +0000 +++ etc/ChangeLog 2010-08-07 09:50:08 +0000 @@ -1,3 +1,7 @@ +2010-08-07 Eli Zaretskii + + * tutorials/TUTORIAL.he: Don't use acronyms. + 2010-08-05 Eli Zaretskii * AUTHORS: Rename unexec.o => unexcoff.o. === modified file 'etc/tutorials/TUTORIAL.he' --- etc/tutorials/TUTORIAL.he 2010-07-31 15:46:58 +0000 +++ etc/tutorials/TUTORIAL.he 2010-08-07 09:50:08 +0000 @@ -16,8 +16,8 @@ לדוגמה: <<שורות ריקות תתווספנה סביב השורה הבאה ע"י help-with-tutorial>> [אמצע העמוד הושאר ריק למטרות לימודיות. הטקסט ממשיך להלן] ->> הקישו עתה C-v (הצג העמוד הבא) ע"מ להתקדם לעמוד הבא. (קדימה, נסו זאת - ע"י לחיצה והחזקה של מקש CONTROL והקשה על v.) +>> הקישו עתה C-v (הצג העמוד הבא) על-מנת להתקדם לעמוד הבא. (קדימה, נסו + זאת ע"י לחיצה והחזקה של מקש CONTROL והקשה על v.) מעתה והלאה, עליכם לעשות זאת בכל פעם שתסיימו לקרוא את המוצג על המסך. שימו לב לחפיפה של שתי שורות כאשר אתם עוברים ממסך למשך, מה שמבטיח רציפות @@ -28,7 +28,7 @@ (החזיקו מקש META והקישו v או הקישו ‭v‬ אם אין במקלדת מקש META או EDIT או ALT). ->> נסו עתה כמה פעמים להקיש M-v ואח"כ C-v. +>> נסו עתה כמה פעמים להקיש M-v ואחר-כך C-v. * סיכום עד כאן @@ -42,7 +42,7 @@ כך שהטקסט ליד הסמן יימצא במרכז התצוגה (שימו לב: CONTROL-L ולא CONTROL-1.) ->> מצאו את הסמן ע"ג התצוגה וזכרו את הטקסט לידו. לאחר מכן הקישו C-l. +>> מצאו את הסמן על-גבי התצוגה וזכרו את הטקסט לידו. לאחר מכן הקישו C-l. מצאו את הסמן שנית ושימו לב שהוא עדיין ליד אותו הטקסט, אבל עכשיו הוא במרכז התצוגה. אם תקישו C-l שוב, קטע הטקסט הזה יזוז לקצה העליון של התצוגה. הקישו @@ -55,7 +55,7 @@ ------------------ תנועה בעמודים שלמים הינה שימושית, אבל כיצד ניתן להגיע למקום ספציפי -בתוך הטקסט ש-ע"ג התצוגה? +בתוך הטקסט שעל-גבי התצוגה? ניתן לעשות זאת בכמה דרכים. אפשר למשל להשתמש במקשי החצים, אולם יהיה זה יעיל יותר אם תחזיקו את הידיים מעל החלק הסטנדרטי של המקלדת ותשתמשו @@ -70,8 +70,8 @@ : השורה הבאה, C-n ->> השתמשו במקשי C-n ו-C-p ע"מ להגיע לשורה האמצעית של הדיאגרמה. - הקישו C-l כדי למרכז את הדיאגרמה ע"ג התצוגה. +>> השתמשו במקשי C-n ו-C-p על-מנת להגיע לשורה האמצעית של הדיאגרמה. + הקישו C-l כדי למרכז את הדיאגרמה על-גבי התצוגה. קל יותר לזכור את המקשים הללו באמצעות המלים שהם מייצגים: P מ-previous (קודם), N מ-Next (הבא), B מ-Backward (אחורה) @@ -83,8 +83,8 @@ שימו לב מה עושה C-p כאשר הסמן נמצא באמצע השורה. כל שורה של טקטס מסתיימת בתו מיוחד הנקרא Newline. תו זה מפריד בין -השורה לזו שאחריה. (ב-ד"כ, השורה האחרונה בקובץ תסתיים אף היא ב-Newline, -אך Emacs אינו זקוק לכך.) +השורה לזו שאחריה. (בדרך כלל, השורה האחרונה בקובץ תסתיים אף היא +ב-Newline, אך Emacs אינו זקוק לכך.) >> נסו C-b בתחילת שורה. הוא יגרום לסמן לנוע לסוף השורה הקודמת. זאת, משום שהוא נע אחורה וחולף על-פני תו ה-Newline. @@ -297,8 +297,8 @@ >> הקישו טקסט עד שתגיעו לקצה השורה, ואז תמשיכו להקיש עוד טקסט. כתוצאה, תראו שמופיעה שורת המשך. ->> עתה הקישו ע"מ למחוק טקסט עד שהשורה תיעשה קצרה מספיק - ותתאים לשורה בודדת ע"ג התצוגה. שורת ההמשך תיעלם. +>> עתה הקישו על-מנת למחוק טקסט עד שהשורה תיעשה קצרה מספיק + ותתאים לשורה בודדת על-גבי התצוגה. שורת ההמשך תיעלם. ניתן למחוק את תו ה-Newline כמו כל תו אחר. מחיקת ה-Newline בין שתי שורות תמזג את השורות לשורה אחת. אם השורה המשולבת תהיה ארוכה מרוחב @@ -312,7 +312,7 @@ זכרו כי לרוב הפקודות ב-Emacs אפשר לציין מספר חזרות. גם תוי טקסט שייכים לקבוצת פקודות זו. חזרה על תו טקסט מכניסה אותו מספר פעמים. ->> נסו זאת עכשיו -- הקישו ‪C-u 8 *‬ ע"מ להכניס ********. +>> נסו זאת עכשיו -- הקישו ‪C-u 8 *‬ על-מנת להכניס ********. ובכן, למדתם את האופן הבסיסי ביותר להדפיס משהו ב-Emacs ולתקן שגיאות. אפשר למחוק גם מלים ואף שורות שלמות. להלן סיכום פקודות המחיקה: @@ -432,7 +432,7 @@ * קבצים ------- -ע"מ שהטקסט שערכתם יישמר, יש לשים אותו בקובץ. אחרת, הוא ייעלם ברגע +על-מנת שהטקסט שערכתם יישמר, יש לשים אותו בקובץ. אחרת, הוא ייעלם ברגע שתצאו מ-Emacs. כדי לשים את הטקס בקובץ, יש "לפתוח" ("find") את הקובץ לפני שמתחילים להקיש טקסט. (שם אחר לכך הוא "לפקוד" את הקובץ - "visit".) @@ -469,7 +469,7 @@ C-x C-f לעבודה ותמצא ותפתח את הקובץ שבחרתם. המיני-חוצץ נעלם כאשר פקודת ה-C-x C-f תסיים את עבודתה. -זמן קצר אחר-כך תוכן הקובץ יופיע ע"ג התצוגה ותוכלו לבצע בו שינויים. +זמן קצר אחר-כך תוכן הקובץ יופיע על-גבי התצוגה ותוכלו לבצע בו שינויים. כשתחליטו לשמור את השינויים, הקישו את הפקודה הבאה: ‏C-x C-s שמור את הקובץ @@ -479,13 +479,13 @@ לאיבוד. השם החדש נוצר ע"י הוספת "~" בסוף השם המקורי של הקובץ. כשהשמירה מסתיימת, Emacs מציג בשורה התחתונה את שם הקובץ שנשמר. נסו -לשמור לעתים מזומנות ע"מ להימנע מלאבד יותר מדי מהעבודה שלכם אם המחשב +לשמור לעתים מזומנות על-מנת להימנע מלאבד יותר מדי מהעבודה שלכם אם המחשב ייפול (ראה להלן פיסקה על שמירה אוטומטית). >> הקישו C-x C-s כדי לשמור את העותק שלכם של השיעור. כתוצאה, תופיע ההודעה "Wrote ... TUTORIAL.he" בתחתית התצוגה. -ניתן לפתוח קובץ קיים ע"מ לצפות בו או לערוך אותו. ניתן גם לפתוח קובץ +ניתן לפתוח קובץ קיים על-מנת לצפות בו או לערוך אותו. ניתן גם לפתוח קובץ שאינו קיים. זו הדרך ליצור קבצים חדשים בעזרת Emacs: פתחו את הקובץ שיהיה תחילה ריק ואז התחילו להקיש טקסט לתוכו. כשתפעילו את פקודת השמירה, Emacs ייצור את הקובץ עם הטקסט שהקשתם. מאותו רגע ואילך, תוכלו לחשוב @@ -537,7 +537,7 @@ שהופיעו בשורה התחתונה במהלך עבודתכם בתוך Emacs. >> הקישו C-x b *Messages* ‎ כדי לצפות בחוצץ של הודעות. - אחר-כך הקישו C-x b TUTORIAL.he ‎ ע"מ לחזור לשיעור זה. + אחר-כך הקישו C-x b TUTORIAL.he ‎ על-מנת לחזור לשיעור זה. אם עשיתם שינויים בטקסט של קובץ ואחר-כך פתחתם קובץ אחר, אין הדבר שומר את השינויים שעשיתם לקובץ הראשון. השינויים הללו נשארים בתוך Emacs, בתוך @@ -577,7 +577,7 @@ לפקודה מיוחדת כדי לעבור מ-Emacs לתוכנית אחרת. אפשר לעשות זאת בעזרת העכבר או פקודות של מנהל החלונות. אולם, כאשר אתם משתמשים בתצוגה טקסטואלית שמסוגלת להציג רק תוכנית אחת בו-זמנית, תצטרכו "להשעות" -("suspend") את Emacs ע"מ לעבור לתוכנית אחרת. +("suspend") את Emacs על-מנת לעבור לתוכנית אחרת. הפקודה C-z יוצאת מ-Emacs *באופן זמני* -- כך שתוכלו לשוב אליו מאוחר יותר ולהמשיך מאותה נקודה. כאשר Emacs רץ על תצוגת טקסט, C-z "משעה" את @@ -587,7 +587,8 @@ הרגע הנכון להשתמש ב-C-x C-c הוא כאשר אתם עומדים להתנתק (log out). כמו-כן, תצטרכו להשתמש בו כדי לצאת מ-Emacs שהופעל ע"י תוכניות אחרות -כגון קריאת דוא"ל -- תוכניות אלו לא תמיד יודעות להסתדר עם השעיית Emacs. +כגון קריאת דואר אלקטרוני -- תוכניות אלו לא תמיד יודעות להסתדר עם +השעיית Emacs. קיימות פקודות C-x רבות מאד. להלן רשימת אלו שכבר למדתם: @@ -624,7 +625,7 @@ ---------------- שינויים שערכתם בקובץ אבל טרם שמרתם עלולים ללכת לאיבוד אם המחשב שלכם -נתקע. ע"מ להגן עליכם מפני סכנה זו, Emacs שומר לעתים מזומנות כל קובץ +נתקע. על-מנת להגן עליכם מפני סכנה זו, Emacs שומר לעתים מזומנות כל קובץ שנמצא בעריכה. השמירה האוטומטית הזאת נעשית לקובץ נפרד ששמו מתחיל ומסתיים בתו #. לדוגמא, אם הינכם עורכים קובץ בשם "hello.c", קובץ השמירה האוטומטית שיווצר עבורו ייקרא "#hello.c#". שמירה רגילה של הקובץ על ידכם @@ -774,7 +775,7 @@ אם במהלך החיפוש תקישו על , תראו שהתו האחרון של המחרוזת המבוקשת נמחק והחיפוש חוזר למקום הקודם בו נמצאה המחרוזת ללא התו האחרון. -למשל, נניח שהקשתם "ס" ע"מ למצוא את המקום הבא בו מופיעה האות "ס". אם +למשל, נניח שהקשתם "ס" על-מנת למצוא את המקום הבא בו מופיעה האות "ס". אם עכשיו תקישו "מ", הסמן יזוז למקום בו נמצא "סמ". עתה הקישו . ה-"מ" נמחק מהמחרוזת והסמן חוזר למקום בו הוא מצא את "ס" לראשונה. @@ -803,8 +804,8 @@ >> הקישו C-M-v כדי לגלול את החלון התחתון. (אם במקלדת שלכם אין מקש META אמיתי, הקישו ‎ C-v כתחליף.) ->> הקישו C-x o ‏("o" הוא רמז ל-"other", "אחר") ע"מ להעביר את הסמן לחלון - התחתון. +>> הקישו C-x o ‏("o" הוא רמז ל-"other", "אחר") על-מנת להעביר את הסמן + לחלון התחתון. >> הקישו C-v ו-M-v בחלון התחתון כדי לגלול אותו. המשיכו לקרוא הוראות אלו בחלון העליון. @@ -930,7 +931,7 @@ כתוצאה, יוצגו השם והתיעוד של הפונקציה בחלון Emacs נפרד. כשתסיימו לקרוא את התיעוד, הקישו C-x 1 כדי לסלק את חלון העזרה. לא חייבים לעשות זאת -מיד. אפשר לבצע קצת עריכה תוך שימוש בתיעוד המוצג ורק אח"כ להקיש C-x 1. +מיד. אפשר לבצע קצת עריכה תוך שימוש בתיעוד המוצג ורק אחר-כך להקיש C-x 1. הנה עוד כמה פקודות עזרה שימושיות: ------------------------------------------------------------ revno: 101012 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-08-07 12:31:03 +0300 message: Evaluate file-local variables in tutorials. tutorial.el (help-with-tutorial): Hack safe file-local variables after reading the tutorial. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-06 19:48:59 +0000 +++ lisp/ChangeLog 2010-08-07 09:31:03 +0000 @@ -1,3 +1,8 @@ +2010-08-07 Eli Zaretskii + + * tutorial.el (help-with-tutorial): Hack safe file-local variables + after reading the tutorial. + 2010-08-06 Alan Mackenzie * progmodes/cc-cmds.el (c-mask-paragraph, c-fill-paragraph): Fix === modified file 'lisp/tutorial.el' --- lisp/tutorial.el 2010-04-14 00:33:32 +0000 +++ lisp/tutorial.el 2010-08-07 09:31:03 +0000 @@ -829,6 +829,8 @@ (if old-tut-file (progn (insert-file-contents (tutorial--saved-file)) + (let ((enable-local-variables :safe)) + (hack-local-variables)) (goto-char (point-min)) (setq old-tut-point (string-to-number @@ -844,6 +846,8 @@ (goto-char tutorial--point-before-chkeys) (setq tutorial--point-before-chkeys (point-marker))) (insert-file-contents (expand-file-name filename tutorial-directory)) + (let ((enable-local-variables :safe)) + (hack-local-variables)) (forward-line) (setq tutorial--point-before-chkeys (point-marker))) ------------------------------------------------------------ revno: 101011 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2010-08-07 03:10:12 +0200 message: Remove duplicate declarations. * lib-src/ebrowse.c (usage, version, mark_virtual) * src/alloc.c (lisp_malloc) * src/buffer.c (set_buffer_internal, set_buffer_internal_1) * src/charset.h (emacs_mule_charset) * src/dispextern.h (inhibit_free_realized_faces, redraw_frame) (redraw_garbaged_frames, scroll_cost, update_frame, scrolling) (bitch_at_user) * src/lisp.h (Fcheck_coding_system, Fget_text_property) (Qfunction, Qcompletion_ignore_case, QCwidth, QCsize) diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-08-06 04:09:54 +0000 +++ lib-src/ChangeLog 2010-08-07 01:10:12 +0000 @@ -1,3 +1,8 @@ +2010-08-07 Juanma Barranquero + + * ebrowse.c (usage, version, mark_virtual): + Remove duplicate declarations. + 2010-08-06 Dan Nicolaescu * emacsclient.c: Move socket related #includes together with the === modified file 'lib-src/ebrowse.c' --- lib-src/ebrowse.c 2010-07-08 05:48:57 +0000 +++ lib-src/ebrowse.c 2010-08-07 01:10:12 +0000 @@ -492,8 +492,6 @@ void insert_keyword (char *, int); void re_init_scanner (void); void init_scanner (void); -void usage (int); -void version (void); void process_file (char *); void add_search_path (char *); FILE *open_file (char *); @@ -504,7 +502,6 @@ struct member *find_member (struct sym *, char *, int, int, unsigned); struct member *add_member (struct sym *, char *, int, int, unsigned); void mark_virtual (struct sym *); -void mark_virtual (struct sym *); struct sym *make_namespace (char *, struct sym *); char *sym_scope (struct sym *); char *sym_scope_1 (struct sym *); === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-06 20:08:26 +0000 +++ src/ChangeLog 2010-08-07 01:10:12 +0000 @@ -1,3 +1,15 @@ +2010-08-07 Juanma Barranquero + + * alloc.c (lisp_malloc): + * buffer.c (set_buffer_internal, set_buffer_internal_1): + * charset.h (emacs_mule_charset): + * dispextern.h (inhibit_free_realized_faces, redraw_frame) + (redraw_garbaged_frames, scroll_cost, update_frame, scrolling) + (bitch_at_user): + * lisp.h (Fcheck_coding_system, Fget_text_property) + (Qfunction, Qcompletion_ignore_case, QCwidth, QCsize): + Remove duplicate declarations. + 2010-08-06 Dan Nicolaescu * process.c: Simplify include logic. === modified file 'src/alloc.c' --- src/alloc.c 2010-07-23 17:50:14 +0000 +++ src/alloc.c 2010-08-07 01:10:12 +0000 @@ -448,7 +448,6 @@ static struct mem_node mem_z; #define MEM_NIL &mem_z -static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); static struct Lisp_Vector *allocate_vectorlike (EMACS_INT); static void lisp_free (POINTER_TYPE *); static void mark_stack (void); === modified file 'src/buffer.c' --- src/buffer.c 2010-07-30 04:42:38 +0000 +++ src/buffer.c 2010-08-07 01:10:12 +0000 @@ -106,8 +106,6 @@ int last_per_buffer_idx; EXFUN (Fset_buffer, 1); -void set_buffer_internal (struct buffer *b); -void set_buffer_internal_1 (struct buffer *b); static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3); === modified file 'src/charset.h' --- src/charset.h 2010-07-02 09:26:33 +0000 +++ src/charset.h 2010-08-07 01:10:12 +0000 @@ -517,8 +517,6 @@ #define EMACS_MULE_LEADING_CODE_PRIVATE_21 0x9C /* 2/2 */ #define EMACS_MULE_LEADING_CODE_PRIVATE_22 0x9D /* 2/2 */ -extern struct charset *emacs_mule_charset[256]; - extern Lisp_Object Qcharsetp; === modified file 'src/dispextern.h' --- src/dispextern.h 2010-08-05 23:15:24 +0000 +++ src/dispextern.h 2010-08-07 01:10:12 +0000 @@ -2430,7 +2430,6 @@ #define PRODUCE_GLYPHS(IT) \ do { \ - extern int inhibit_free_realized_faces; \ if ((IT)->glyph_row != NULL && (IT)->bidi_p) \ { \ if ((IT)->bidi_it.paragraph_dir == R2L) \ @@ -3243,15 +3242,9 @@ void prepare_desired_row (struct glyph_row *); int line_hash_code (struct glyph_row *); void set_window_update_flags (struct window *, int); -void redraw_frame (struct frame *); -void redraw_garbaged_frames (void); -int scroll_cost (struct frame *, int, int, int); -int update_frame (struct frame *, int, int); void update_single_window (struct window *, int); -int scrolling (struct frame *); void do_pending_window_change (int); void change_frame_size (struct frame *, int, int, int, int, int); -void bitch_at_user (void); void init_display (void); void syms_of_display (void); extern Lisp_Object Qredisplay_dont_pause; === modified file 'src/lisp.h' --- src/lisp.h 2010-08-06 18:56:41 +0000 +++ src/lisp.h 2010-08-07 01:10:12 +0000 @@ -2395,7 +2395,6 @@ EXFUN (Fcoding_system_base, 1); EXFUN (Fcoding_system_eol_type, 1); EXFUN (Fcheck_coding_system, 1); -EXFUN (Fcheck_coding_system, 1); EXFUN (Fread_coding_system, 2); EXFUN (Fread_non_nil_coding_system, 1); EXFUN (Ffind_operation_coding_system, MANY); @@ -2822,7 +2821,6 @@ /* Defined in lread.c */ extern Lisp_Object Vafter_load_alist; extern Lisp_Object Qvariable_documentation, Qstandard_input; -extern Lisp_Object Qfunction; extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; extern Lisp_Object Vobarray, initial_obarray, Vstandard_input; extern int load_in_progress; @@ -3135,7 +3133,6 @@ /* Defined in minibuf.c */ extern Lisp_Object Qcompletion_ignore_case; -extern Lisp_Object Qcompletion_ignore_case; extern Lisp_Object Vcompletion_regexp_list; extern Lisp_Object Vhistory_length; extern Lisp_Object Vminibuffer_list; @@ -3417,7 +3414,6 @@ EXFUN (Fprevious_single_property_change, 4); EXFUN (Fget_text_property, 3); EXFUN (Fput_text_property, 5); -EXFUN (Fget_text_property, 3); EXFUN (Fprevious_char_property_change, 2); EXFUN (Fnext_char_property_change, 2); extern void report_interval_modification (Lisp_Object, Lisp_Object); @@ -3540,8 +3536,8 @@ extern Lisp_Object Qmode_line_inactive, Qvertical_border; extern Lisp_Object Qface; extern Lisp_Object Qnormal; -extern Lisp_Object QCfamily, QCweight, QCslant, QCwidth; -extern Lisp_Object QCheight, QCsize, QCname, QCwidth, QCforeground, QCbackground; +extern Lisp_Object QCfamily, QCweight, QCslant; +extern Lisp_Object QCheight, QCname, QCwidth, QCforeground, QCbackground; extern Lisp_Object Vface_alternative_font_family_alist; extern Lisp_Object Vface_font_rescale_alist; extern Lisp_Object Vface_ignored_fonts; ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.