Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101187. ------------------------------------------------------------ revno: 101187 committer: Jan D branch nick: trunk timestamp: Wed 2010-08-25 08:53:55 +0200 message: * menu-bar.el (menu-bar-set-tool-bar-position): Set frame parameter on all frames. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-25 02:27:58 +0000 +++ lisp/ChangeLog 2010-08-25 06:53:55 +0000 @@ -1,3 +1,8 @@ +2010-08-25 Jan Djärv + + * menu-bar.el (menu-bar-set-tool-bar-position): Set frame parameter + on all frames. + 2010-08-24 Vinicius Jose Latorre * whitespace.el: Allow cleaning up blanks without blank === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2010-08-22 20:02:16 +0000 +++ lisp/menu-bar.el 2010-08-25 06:53:55 +0000 @@ -970,7 +970,8 @@ (defun menu-bar-set-tool-bar-position (position) (customize-set-variable 'tool-bar-mode t) - (set-frame-parameter nil 'tool-bar-position position) + (dolist (frame (frame-list)) + (set-frame-parameter frame 'tool-bar-position position)) (customize-set-variable 'default-frame-alist (cons (cons 'tool-bar-position position) (assq-delete-all 'tool-bar-position ------------------------------------------------------------ revno: 101186 [merge] committer: Kenichi Handa branch nick: trunk timestamp: Wed 2010-08-25 15:10:09 +0900 message: fontset.c (reorder_font_vector): Prefer a font-spec specifying :otf. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-25 04:39:30 +0000 +++ src/ChangeLog 2010-08-25 05:58:15 +0000 @@ -1,5 +1,8 @@ 2010-08-25 Kenichi Handa + * fontset.c (reorder_font_vector): Prefer a font-spec specifying + :otf. + * composite.c (composition_compute_stop_pos): Don't break composition at PT. (composition_reseat_it): Likewise. Fix calculation of character === modified file 'src/fontset.c' --- src/fontset.c 2010-08-05 23:34:12 +0000 +++ src/fontset.c 2010-08-25 05:58:15 +0000 @@ -283,6 +283,10 @@ #define RFONT_DEF_OBJECT(rfont_def) AREF (rfont_def, 2) #define RFONT_DEF_SET_OBJECT(rfont_def, object) \ ASET ((rfont_def), 2, (object)) +/* Score of RFONT_DEF is an integer value; the lowest 8 bits represent + the order of listing by font backends, the higher bits represents + the order given by charset priority list. The smaller value is + preferable. */ #define RFONT_DEF_SCORE(rfont_def) XINT (AREF (rfont_def, 3)) #define RFONT_DEF_SET_SCORE(rfont_def, score) \ ASET ((rfont_def), 3, make_number (score)) @@ -412,8 +416,13 @@ Lisp_Object font_def = RFONT_DEF_FONT_DEF (rfont_def); Lisp_Object font_spec = FONT_DEF_SPEC (font_def); int score = RFONT_DEF_SCORE (rfont_def) & 0xFF; + Lisp_Object otf_spec = Ffont_get (font_spec, QCotf); - if (! font_match_p (font_spec, font_object)) + if (! NILP (otf_spec)) + /* A font-spec with :otf is preferable regardless of encoding + and language.. */ + ; + else if (! font_match_p (font_spec, font_object)) { Lisp_Object encoding = FONT_DEF_ENCODING (font_def); ------------------------------------------------------------ revno: 101185 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2010-08-25 01:23:47 -0400 message: Fix last change in processes.texi. processes.texi (Filter Functions): Fix last change. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-08-24 20:43:24 +0000 +++ doc/lispref/ChangeLog 2010-08-25 05:23:47 +0000 @@ -1,3 +1,7 @@ +2010-08-25 Eli Zaretskii + + * processes.texi (Filter Functions): Fix last change. + 2010-08-24 Markus Triska * processes.texi (Filter Functions): Use `buffer-live-p' instead === modified file 'doc/lispref/processes.texi' --- doc/lispref/processes.texi 2010-08-24 20:43:24 +0000 +++ doc/lispref/processes.texi 2010-08-25 05:23:47 +0000 @@ -1286,7 +1286,7 @@ @end group @group (save-excursion - ;; r{Insert the text, advancing the process marker.} + ;; @r{Insert the text, advancing the process marker.} (goto-char (process-mark proc)) (insert string) (set-marker (process-mark proc) (point))) ------------------------------------------------------------ revno: 101184 [merge] committer: Kenichi Handa branch nick: trunk timestamp: Wed 2010-08-25 13:41:32 +0900 message: Allow composition striding over PT. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-25 03:49:02 +0000 +++ src/ChangeLog 2010-08-25 04:39:30 +0000 @@ -1,5 +1,14 @@ 2010-08-25 Kenichi Handa + * composite.c (composition_compute_stop_pos): Don't break + composition at PT. + (composition_reseat_it): Likewise. Fix calculation of character + position starting a composition. + (Fcomposition_get_gstring): Don't limit the number of components + for automatic composition. + +2010-08-25 Kenichi Handa + * composite.c (composition_compute_stop_pos): In forward search, pay attention to the possibility that some character after ENDPOS will be composed with charactrs before ENDPOS. === modified file 'src/composite.c' --- src/composite.c 2010-08-25 00:54:05 +0000 +++ src/composite.c 2010-08-25 04:39:30 +0000 @@ -969,7 +969,9 @@ static Lisp_Object _work_val; static int _work_char; -/* 1 iff the character C is composable. */ +/* 1 iff the character C is composable. Characters of general + category Z? or C? are not composable except for ZWNJ and ZWJ. */ + #define CHAR_COMPOSABLE_P(C) \ ((C) == 0x200C || (C) == 0x200D \ || (_work_val = CHAR_TABLE_REF (Vunicode_category_table, (C)), \ @@ -1028,19 +1030,6 @@ cmp_it->stop_pos = endpos = start; cmp_it->ch = -1; } - if (NILP (string)) - { - /* A composition never strides over PT. */ - if (PT > charpos) - { - if (PT < endpos) - cmp_it->stop_pos = endpos = PT; - } - else if (PT < charpos && PT > endpos) - { - cmp_it->stop_pos = endpos = PT - 1; - } - } if (NILP (current_buffer->enable_multibyte_characters) || NILP (Vauto_composition_mode)) return; @@ -1233,23 +1222,8 @@ int composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT endpos, struct window *w, struct face *face, Lisp_Object string) { - if (endpos <= charpos) - { - if (NILP (string)) - { - if (endpos < 0) - endpos = BEGV; - if (endpos < PT && PT < charpos) - endpos = PT; - } - else if (endpos < 0) - endpos = 0; - } - else - { - if (NILP (string) && charpos < PT && PT < endpos) - endpos = PT; - } + if (endpos < 0) + endpos = NILP (string) ? BEGV : 0; if (cmp_it->ch == -2) { @@ -1311,7 +1285,7 @@ elt = XCAR (val); if (cmp_it->lookback > 0) { - cpos -= cmp_it->lookback; + cpos = charpos - cmp_it->lookback; if (STRINGP (string)) bpos = string_char_to_byte (string, cpos); else @@ -1773,8 +1747,6 @@ CHECK_NATNUM (from); CHECK_NATNUM (to); - if (XINT (to) > XINT (from) + MAX_COMPOSITION_COMPONENTS) - to = make_number (XINT (from) + MAX_COMPOSITION_COMPONENTS); if (! FONT_OBJECT_P (font_object)) { struct coding_system *coding; ------------------------------------------------------------ revno: 101183 [merge] committer: Kenichi Handa branch nick: trunk timestamp: Wed 2010-08-25 13:07:22 +0900 message: Fix finding a stop position for composition. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-24 15:48:14 +0000 +++ src/ChangeLog 2010-08-25 03:49:02 +0000 @@ -1,3 +1,9 @@ +2010-08-25 Kenichi Handa + + * composite.c (composition_compute_stop_pos): In forward search, + pay attention to the possibility that some character after ENDPOS + will be composed with charactrs before ENDPOS. + 2010-08-24 Chong Yidong * keyboard.c (command_loop_1): Don't clobber primary selection === modified file 'src/composite.c' --- src/composite.c 2010-07-29 05:48:06 +0000 +++ src/composite.c 2010-08-25 00:54:05 +0000 @@ -1091,6 +1091,16 @@ } } } + if (charpos == endpos) + { + /* We couldn't find a composition point before ENDPOS. But, + some character after ENDPOS may be composed with + characters before ENDPOS. So, we should stop at the safe + point. */ + charpos = endpos - MAX_AUTO_COMPOSITION_LOOKBACK; + if (charpos < start) + charpos = start; + } } else if (charpos > endpos) { ------------------------------------------------------------ revno: 101182 committer: Vinicius Jose Latorre + + * whitespace.el: Allow cleaning up blanks without blank + visualization (Bug#6651). Adjust help window for + whitespace-toggle-options (Bug#6479). Allow to use fill-column + instead of whitespace-line-column (from EmacsWiki). New version + 13.1. + (whitespace-style): Added new value 'face. Adjust docstring. + (whitespace-space, whitespace-hspace, whitespace-tab): Adjust + foreground property face. + (whitespace-line-column): Adjust docstring and type declaration. + (whitespace-style-value-list, whitespace-toggle-option-alist) + (whitespace-help-text): Adjust const initialization. + (whitespace-toggle-options, global-whitespace-toggle-options): + Adjust docstring. + (whitespace-display-window, whitespace-interactive-char) + (whitespace-style-face-p, whitespace-color-on): Adjust code. + (whitespace-help-scroll): New fun. + 2010-08-24 Chong Yidong * emacs-lisp/package.el (list-packages): Alias for @@ -164,7 +183,7 @@ (whitespace-post-command-hook, whitespace-display-char-on): Adjust code. (whitespace-looking-back, whitespace-buffer-changed): New funs. - (whitespace-space-regexp, whitespace-tab-regexp): Eliminate funs. + (whitespace-space-regexp, whitespace-tab-regexp): Fun eliminated. 2010-08-19 Stefan Monnier === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2010-08-22 20:02:16 +0000 +++ lisp/whitespace.el 2010-08-25 02:27:58 +0000 @@ -6,7 +6,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: data, wp -;; Version: 13.0 +;; Version: 13.1 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre ;; This file is part of GNU Emacs. @@ -382,19 +382,28 @@ (defcustom whitespace-style - '(tabs spaces trailing lines space-before-tab newline - indentation empty space-after-tab - space-mark tab-mark newline-mark) + '(face + tabs spaces trailing lines space-before-tab newline + indentation empty space-after-tab + space-mark tab-mark newline-mark) "Specify which kind of blank is visualized. It's a list containing some or all of the following values: + face enable all visualization via faces (see below). + trailing trailing blanks are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. tabs TABs are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. spaces SPACEs and HARD SPACEs are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. lines lines which have columns beyond `whitespace-line-column' are highlighted via @@ -402,6 +411,8 @@ Whole line is highlighted. It has precedence over `lines-tail' (see below). + It has effect only if `face' (see above) + is present in `whitespace-style'. lines-tail lines which have columns beyond `whitespace-line-column' are highlighted via @@ -409,45 +420,69 @@ But only the part of line which goes beyond `whitespace-line-column' column. It has effect only if `lines' (see above) - is not present in `whitespace-style'. + is not present in `whitespace-style' + and if `face' (see above) is present in + `whitespace-style'. newline NEWLINEs are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. empty empty lines at beginning and/or end of buffer are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. indentation::tab 8 or more SPACEs at beginning of line are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. indentation::space TABs at beginning of line are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. indentation 8 or more SPACEs at beginning of line are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, TABs at beginning of line are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. space-after-tab::tab 8 or more SPACEs after a TAB are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. space-after-tab::space TABs are visualized when 8 or more SPACEs occur after a TAB, via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. space-after-tab 8 or more SPACEs after a TAB are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, the TABs are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. space-before-tab::tab SPACEs before TAB are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. space-before-tab::space TABs are visualized when SPACEs occur before TAB, via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. space-before-tab SPACEs before TAB are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, the TABs are visualized via faces. + It has effect only if `face' (see above) + is present in `whitespace-style'. space-mark SPACEs and HARD SPACEs are visualized via display table. @@ -486,6 +521,11 @@ included in `whitespace-style' list, the indentation value is evaluated instead of indentation::space value. +One reason for not visualize spaces via faces (if `face' is not +included in `whitespace-style') is to use exclusively for +cleanning up a buffer. See `whitespace-cleanup' and +`whitespace-cleanup-region' for documentation. + See also `whitespace-display-mappings' for documentation." :type '(repeat :tag "Kind of Blank" (choice :tag "Kind of Blank Face" @@ -521,9 +561,9 @@ (defface whitespace-space '((((class color) (background dark)) - (:background "grey20" :foreground "aquamarine3")) + (:background "grey20" :foreground "darkgray")) (((class color) (background light)) - (:background "LightYellow" :foreground "aquamarine3")) + (:background "LightYellow" :foreground "lightgray")) (t (:inverse-video t))) "Face used to visualize SPACE." :group 'whitespace) @@ -539,9 +579,9 @@ (defface whitespace-hspace ; 'nobreak-space '((((class color) (background dark)) - (:background "grey24" :foreground "aquamarine3")) + (:background "grey24" :foreground "darkgray")) (((class color) (background light)) - (:background "LemonChiffon3" :foreground "aquamarine3")) + (:background "LemonChiffon3" :foreground "lightgray")) (t (:inverse-video t))) "Face used to visualize HARD SPACE." :group 'whitespace) @@ -557,9 +597,9 @@ (defface whitespace-tab '((((class color) (background dark)) - (:background "grey22" :foreground "aquamarine3")) + (:background "grey22" :foreground "darkgray")) (((class color) (background light)) - (:background "beige" :foreground "aquamarine3")) + (:background "beige" :foreground "lightgray")) (t (:inverse-video t))) "Face used to visualize TAB." :group 'whitespace) @@ -866,8 +906,13 @@ (defcustom whitespace-line-column 80 "Specify column beyond which the line is highlighted. +It must be an integer or nil. If nil, the `fill-column' variable value is +used. + Used when `whitespace-style' includes `lines' or `lines-tail'." - :type '(integer :tag "Line Length") + :type '(choice :tag "Line Length Limit" + (integer :tag "Line Length") + (const :tag "Use fill-column" nil)) :group 'whitespace) @@ -1151,7 +1196,8 @@ (defconst whitespace-style-value-list - '(tabs + '(face + tabs spaces trailing lines @@ -1176,7 +1222,8 @@ (defconst whitespace-toggle-option-alist - '((?t . tabs) + '((?f . face) + (?t . tabs) (?s . spaces) (?r . trailing) (?l . lines) @@ -1256,6 +1303,7 @@ CHAR MEANING (VIA FACES) + f toggle face visualization t toggle TAB visualization s toggle SPACE and HARD SPACE visualization r toggle trailing blanks visualization @@ -1284,6 +1332,7 @@ Non-interactively, ARG should be a symbol or a list of symbols. The valid symbols are: + face toggle face visualization tabs toggle TAB visualization spaces toggle SPACE and HARD SPACE visualization trailing toggle trailing blanks visualization @@ -1333,6 +1382,7 @@ CHAR MEANING (VIA FACES) + f toggle face visualization t toggle TAB visualization s toggle SPACE and HARD SPACE visualization r toggle trailing blanks visualization @@ -1361,6 +1411,7 @@ Non-interactively, ARG should be a symbol or a list of symbols. The valid symbols are: + face toggle face visualization tabs toggle TAB visualization spaces toggle SPACE and HARD SPACE visualization trailing toggle trailing blanks visualization @@ -1890,9 +1941,10 @@ (defconst whitespace-help-text "\ - Whitespace Toggle Options - - FACES + Whitespace Toggle Options | scroll up : SPC or > | + | scroll down: M-SPC or < | + FACES \\__________________________/ + [] f - toggle face visualization [] t - toggle TAB visualization [] s - toggle SPACE and HARD SPACE visualization [] r - toggle trailing blanks visualization @@ -1966,15 +2018,13 @@ "Display BUFFER in a new window." (goto-char (point-min)) (set-buffer-modified-p nil) - (let ((size (- (window-height) - (max window-min-height - (1+ (count-lines (point-min) - (point-max))))))) - (when (<= size 0) - (kill-buffer buffer) - (error "Frame height is too small; \ + (when (< (window-height) (* 2 window-min-height)) + (kill-buffer buffer) + (error "Window height is too small; \ can't split window to display whitespace toggle options")) - (set-window-buffer (split-window nil size) buffer))) + (let ((win (split-window))) + (set-window-buffer win buffer) + (shrink-window-if-larger-than-buffer win))) (defun whitespace-kill-buffer (buffer-name) @@ -1990,6 +2040,24 @@ (whitespace-kill-buffer whitespace-help-buffer-name)) +(defun whitespace-help-scroll (&optional up) + "Scroll help window, if it exists. + +If UP is non-nil, scroll up; otherwise, scroll down." + (condition-case data-help + (let ((buffer (get-buffer whitespace-help-buffer-name))) + (if buffer + (with-selected-window (get-buffer-window buffer) + (if up + (scroll-up 3) + (scroll-down 3))) + (ding))) + ;; handler + ((error) + ;; just ignore error + ))) + + (defun whitespace-interactive-char (local-p) "Interactive function to read a char and return a symbol. @@ -2000,6 +2068,7 @@ CHAR MEANING (VIA FACES) + f toggle face visualization t toggle TAB visualization s toggle SPACE and HARD SPACE visualization r toggle trailing blanks visualization @@ -2049,9 +2118,13 @@ (cdr (assq ch whitespace-toggle-option-alist))))) ;; while body - (if (eq ch ?\?) - (whitespace-help-on style) - (ding))) + (cond + ((eq ch ?\?) (whitespace-help-on style)) + ((eq ch ?\ ) (whitespace-help-scroll t)) + ((eq ch ?\M- ) (whitespace-help-scroll)) + ((eq ch ?>) (whitespace-help-scroll t)) + ((eq ch ?<) (whitespace-help-scroll)) + (t (ding)))) (whitespace-help-off) (message " ")) ; clean echo area ;; handler @@ -2130,22 +2203,23 @@ (defun whitespace-style-face-p () "Return t if there is some visualization via face." - (or (memq 'tabs whitespace-active-style) - (memq 'spaces whitespace-active-style) - (memq 'trailing whitespace-active-style) - (memq 'lines whitespace-active-style) - (memq 'lines-tail whitespace-active-style) - (memq 'newline whitespace-active-style) - (memq 'empty whitespace-active-style) - (memq 'indentation whitespace-active-style) - (memq 'indentation::tab whitespace-active-style) - (memq 'indentation::space whitespace-active-style) - (memq 'space-after-tab whitespace-active-style) - (memq 'space-after-tab::tab whitespace-active-style) - (memq 'space-after-tab::space whitespace-active-style) - (memq 'space-before-tab whitespace-active-style) - (memq 'space-before-tab::tab whitespace-active-style) - (memq 'space-before-tab::space whitespace-active-style))) + (and (memq 'face whitespace-active-style) + (or (memq 'tabs whitespace-active-style) + (memq 'spaces whitespace-active-style) + (memq 'trailing whitespace-active-style) + (memq 'lines whitespace-active-style) + (memq 'lines-tail whitespace-active-style) + (memq 'newline whitespace-active-style) + (memq 'empty whitespace-active-style) + (memq 'indentation whitespace-active-style) + (memq 'indentation::tab whitespace-active-style) + (memq 'indentation::space whitespace-active-style) + (memq 'space-after-tab whitespace-active-style) + (memq 'space-after-tab::tab whitespace-active-style) + (memq 'space-after-tab::space whitespace-active-style) + (memq 'space-before-tab whitespace-active-style) + (memq 'space-before-tab::tab whitespace-active-style) + (memq 'space-before-tab::space whitespace-active-style)))) (defun whitespace-color-on () @@ -2203,14 +2277,16 @@ (list ;; Show "long" lines (list - (format - "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$" - whitespace-tab-width (1- whitespace-tab-width) - (/ whitespace-line-column whitespace-tab-width) - (let ((rem (% whitespace-line-column whitespace-tab-width))) - (if (zerop rem) - "" - (format ".\\{%d\\}" rem)))) + (let ((line-column (or whitespace-line-column fill-column))) + (format + "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$" + whitespace-tab-width + (1- whitespace-tab-width) + (/ line-column whitespace-tab-width) + (let ((rem (% line-column whitespace-tab-width))) + (if (zerop rem) + "" + (format ".\\{%d\\}" rem))))) (if (memq 'lines whitespace-active-style) 0 ; whole line 2) ; line tail ------------------------------------------------------------ revno: 101181 committer: Chong Yidong branch nick: trunk timestamp: Tue 2010-08-24 17:36:33 -0400 message: * emacs-lisp/package.el (list-packages): Alias for package-list-packages. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-24 20:58:07 +0000 +++ lisp/ChangeLog 2010-08-24 21:36:33 +0000 @@ -1,3 +1,8 @@ +2010-08-24 Chong Yidong + + * emacs-lisp/package.el (list-packages): Alias for + package-list-packages. + 2010-08-24 Kevin Ryde * textmodes/flyspell.el (flyspell-check-tex-math-command): Doc fix === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2010-08-09 18:05:56 +0000 +++ lisp/emacs-lisp/package.el 2010-08-24 21:36:33 +0000 @@ -1557,6 +1557,9 @@ (package-refresh-contents) (package--list-packages)) +;;;###autoload +(defalias 'list-packages 'package-list-packages) + (defun package-list-packages-no-fetch () "Display a list of packages. Does not fetch the updated list of packages before displaying. ------------------------------------------------------------ revno: 101180 author: Kevin Ryde committer: Chong Yidong branch nick: trunk timestamp: Tue 2010-08-24 16:58:07 -0400 message: * textmodes/flyspell.el (flyspell-check-tex-math-command): Doc fix (Bug#5651). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-24 20:29:44 +0000 +++ lisp/ChangeLog 2010-08-24 20:58:07 +0000 @@ -1,5 +1,8 @@ 2010-08-24 Kevin Ryde + * textmodes/flyspell.el (flyspell-check-tex-math-command): Doc fix + (Bug#5651). + * progmodes/ruby-mode.el (ruby): Add defgroup. 2010-08-24 Chong Yidong === modified file 'lisp/textmodes/flyspell.el' --- lisp/textmodes/flyspell.el 2010-06-25 08:19:11 +0000 +++ lisp/textmodes/flyspell.el 2010-08-24 20:58:07 +0000 @@ -199,9 +199,9 @@ (defcustom flyspell-check-tex-math-command nil "Non-nil means check even inside TeX math environment. -TeX math environments are discovered by the TEXMATHP that implemented -inside the texmathp.el Emacs package. That package may be found at: -http://strw.leidenuniv.nl/~dominik/Tools" +TeX math environments are discovered by `texmathp', implemented +inside AUCTeX package. That package may be found at +URL `http://www.gnu.org/software/auctex/'" :group 'flyspell :type 'boolean) ------------------------------------------------------------ revno: 101179 committer: Chong Yidong branch nick: trunk timestamp: Tue 2010-08-24 16:43:24 -0400 message: Fix filter functions discussion in Lisp manual. * processes.texi (Filter Functions): Use `buffer-live-p' instead of `buffer-name' in the main text as well as in the example (Bug#3098). diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-08-22 21:15:20 +0000 +++ doc/lispref/ChangeLog 2010-08-24 20:43:24 +0000 @@ -1,3 +1,9 @@ +2010-08-24 Markus Triska + + * processes.texi (Filter Functions): Use `buffer-live-p' instead + of `buffer-name' in the main text as well as in the example + (Bug#3098). + 2010-08-22 Chong Yidong * nonascii.texi (Text Representations): === modified file 'doc/lispref/processes.texi' --- doc/lispref/processes.texi 2010-07-29 13:54:03 +0000 +++ doc/lispref/processes.texi 2010-08-24 20:43:24 +0000 @@ -1273,22 +1273,24 @@ filter. Such filter functions need to use @code{set-buffer} in order to be sure to insert in that buffer. To avoid setting the current buffer semipermanently, these filter functions must save and restore the -current buffer. They should also update the process marker, and in some -cases update the value of point. Here is how to do these things: +current buffer. They should also check whether the buffer is still +alive, update the process marker, and in some cases update the value +of point. Here is how to do these things: @smallexample @group (defun ordinary-insertion-filter (proc string) - (with-current-buffer (process-buffer proc) - (let ((moving (= (point) (process-mark proc)))) + (when (buffer-live-p (process-buffer proc)) + (with-current-buffer (process-buffer proc) + (let ((moving (= (point) (process-mark proc)))) @end group @group - (save-excursion - ;; @r{Insert the text, advancing the process marker.} - (goto-char (process-mark proc)) - (insert string) - (set-marker (process-mark proc) (point))) - (if moving (goto-char (process-mark proc)))))) + (save-excursion + ;; r{Insert the text, advancing the process marker.} + (goto-char (process-mark proc)) + (insert string) + (set-marker (process-mark proc) (point))) + (if moving (goto-char (process-mark proc))))))) @end group @end smallexample @@ -1315,12 +1317,6 @@ match data. Now Emacs does this automatically for filter functions; they never need to do it explicitly. @xref{Match Data}. - A filter function that writes the output into the buffer of the -process should check whether the buffer is still alive. If it tries to -insert into a dead buffer, it will get an error. The expression -@code{(buffer-name (process-buffer @var{process}))} returns @code{nil} -if the buffer is dead. - The output to the function may come in chunks of any size. A program that produces the same output twice in a row may send it as one batch of 200 characters one time, and five batches of 40 characters the next. If ------------------------------------------------------------ revno: 101178 author: Kevin Ryde committer: Chong Yidong branch nick: trunk timestamp: Tue 2010-08-24 16:29:44 -0400 message: * progmodes/ruby-mode.el (ruby): Add defgroup. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-24 20:20:21 +0000 +++ lisp/ChangeLog 2010-08-24 20:29:44 +0000 @@ -1,3 +1,7 @@ +2010-08-24 Kevin Ryde + + * progmodes/ruby-mode.el (ruby): Add defgroup. + 2010-08-24 Chong Yidong * progmodes/python.el: Add Ipython support (Bug#5390). === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2010-06-27 18:18:49 +0000 +++ lisp/progmodes/ruby-mode.el 2010-08-24 20:29:44 +0000 @@ -43,6 +43,11 @@ (eval-when-compile (require 'cl)) +(defgroup ruby nil + "Major mode for editing Ruby code." + :prefix "ruby-" + :group 'languages) + (defconst ruby-keyword-end-re (if (string-match "\\_>" "ruby") "\\_>" ------------------------------------------------------------ revno: 101177 committer: Chong Yidong branch nick: trunk timestamp: Tue 2010-08-24 16:20:21 -0400 message: * lisp/progmodes/python.el: Add Ipython support (Bug#5390). Based on a patch by Fabian Ezequiel Gallina. (python-shell-prompt-alist) (python-shell-continuation-prompt-alist): New options. (python--set-prompt-regexp): New function. (inferior-python-mode, run-python, python-shell): Require ansi-color. Use python--set-prompt-regexp to set the comint prompt based on the Python interpreter. (python--prompt-regexp): New var. (python-check-comint-prompt) (python-comint-output-filter-function): Use it. (run-python): Use a pipe (Bug#5694). (python-send-region): Send a different Python command if Ipython is in use. (python-check-version): Use a Python command to find the version. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-24 15:48:14 +0000 +++ lisp/ChangeLog 2010-08-24 20:20:21 +0000 @@ -1,5 +1,25 @@ 2010-08-24 Chong Yidong + * progmodes/python.el: Add Ipython support (Bug#5390). + (python-shell-prompt-alist) + (python-shell-continuation-prompt-alist): New options. + (python--set-prompt-regexp): New function. + (inferior-python-mode, run-python, python-shell): Require + ansi-color. Use python--set-prompt-regexp to set the comint + prompt based on the Python interpreter. + (python--prompt-regexp): New var. + (python-check-comint-prompt) + (python-comint-output-filter-function): Use it. + (run-python): Use a pipe (Bug#5694). + +2010-08-24 Fabian Ezequiel Gallina (tiny change) + + * progmodes/python.el (python-send-region): Send a different + Python command if Ipython is in use. + (python-check-version): Use a Python command to find the version. + +2010-08-24 Chong Yidong + * mouse.el (mouse-yank-primary): Avoid setting primary when deactivating the mark (Bug#6872). === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2010-07-07 04:46:58 +0000 +++ lisp/progmodes/python.el 2010-08-24 20:20:21 +0000 @@ -579,6 +579,33 @@ "Queue of Python temp files awaiting execution. Currently-active file is at the head of the list.") +(defcustom python-shell-prompt-alist + '(("ipython" . "^In \\[[0-9]+\\]: *") + (t . "^>>> ")) + "Alist of Python input prompts. +Each element has the form (PROGRAM . REGEXP), where PROGRAM is +the value of `python-python-command' for the python process and +REGEXP is a regular expression matching the Python prompt. +PROGRAM can also be t, which specifies the default when no other +element matches `python-python-command'." + :type 'string + :group 'python + :version "24.1") + +(defcustom python-shell-continuation-prompt-alist + '(("ipython" . "^ [.][.][.]+: *") + (t . "^[.][.][.] ")) + "Alist of Python continued-line prompts. +Each element has the form (PROGRAM . REGEXP), where PROGRAM is +the value of `python-python-command' for the python process and +REGEXP is a regular expression matching the Python prompt for +continued lines. +PROGRAM can also be t, which specifies the default when no other +element matches `python-python-command'." + :type 'string + :group 'python + :version "24.1") + (defvar python-pdbtrack-is-tracking-p nil) (defconst python-pdbtrack-stack-entry-regexp @@ -1311,13 +1338,9 @@ ;;;; Inferior mode stuff (following cmuscheme). -;; Fixme: Make sure we can work with IPython. - (defcustom python-python-command "python" "Shell command to run Python interpreter. -Any arguments can't contain whitespace. -Note that IPython may not work properly; it must at least be used -with the `-cl' flag, i.e. use `ipython -cl'." +Any arguments can't contain whitespace." :group 'python :type 'string) @@ -1395,6 +1418,23 @@ ;; Autoloaded. (declare-function compilation-shell-minor-mode "compile" (&optional arg)) +(defvar python--prompt-regexp nil) + +(defun python--set-prompt-regexp () + (let ((prompt (cdr-safe (or (assoc python-python-command + python-shell-prompt-alist) + (assq t python-shell-prompt-alist)))) + (cprompt (cdr-safe (or (assoc python-python-command + python-shell-continuation-prompt-alist) + (assq t python-shell-continuation-prompt-alist))))) + (set (make-local-variable 'comint-prompt-regexp) + (concat "\\(" + (mapconcat 'identity + (delq nil (list prompt cprompt "^([Pp]db) ")) + "\\|") + "\\)")) + (set (make-local-variable 'python--prompt-regexp) prompt))) + ;; Fixme: This should inherit some stuff from `python-mode', but I'm ;; not sure how much: at least some keybindings, like C-c C-f; ;; syntax?; font-locking, e.g. for triple-quoted strings? @@ -1417,14 +1457,12 @@ \\{inferior-python-mode-map}" :group 'python + (require 'ansi-color) ; for ipython (setq mode-line-process '(":%s")) (set (make-local-variable 'comint-input-filter) 'python-input-filter) (add-hook 'comint-preoutput-filter-functions #'python-preoutput-filter nil t) - ;; Still required by `comint-redirect-send-command', for instance - ;; (and we need to match things like `>>> ... >>> '): - (set (make-local-variable 'comint-prompt-regexp) - (rx line-start (1+ (and (or (repeat 3 (any ">.")) "(Pdb)") " ")))) + (python--set-prompt-regexp) (set (make-local-variable 'compilation-error-regexp-alist) python-compilation-regexp-alist) (compilation-shell-minor-mode 1)) @@ -1521,12 +1559,12 @@ cmd))) (unless (shell-command-to-string cmd) (error "Can't run Python command `%s'" cmd)) - (let* ((res (shell-command-to-string (concat cmd " --version")))) - (string-match "Python \\([0-9]\\)\\.\\([0-9]\\)" res) - (unless (and (equal "2" (match-string 1 res)) - (match-beginning 2) - (>= (string-to-number (match-string 2 res)) 2)) - (error "Only Python versions >= 2.2 and < 3.0 supported"))) + (let* ((res (shell-command-to-string + (concat cmd + " -c \"from sys import version_info;\ +print version_info >= (2, 2) and version_info < (3, 0)\"")))) + (unless (string-match "True" res) + (error "Only Python versions >= 2.2 and < 3.0 are supported"))) (setq python-version-checked t))) ;;;###autoload @@ -1549,6 +1587,7 @@ (interactive (if current-prefix-arg (list (read-string "Run Python: " python-command) nil t) (list python-command))) + (require 'ansi-color) ; for ipython (unless cmd (setq cmd python-command)) (python-check-version cmd) (setq python-command cmd) @@ -1566,8 +1605,10 @@ (if path (concat path path-separator)) data-directory) process-environment)) - ;; Suppress use of pager for help output: - (process-connection-type nil)) + ;; If we use a pipe, unicode characters are not printed + ;; correctly (Bug#5794) and IPython does not work at + ;; all (Bug#5390). + (process-connection-type t)) (apply 'make-comint-in-buffer "Python" (generate-new-buffer "*Python*") (car cmdlist) nil (cdr cmdlist))) @@ -1623,7 +1664,12 @@ ;; non-ASCII. (interactive "r") (let* ((f (make-temp-file "py")) - (command (format "emacs.eexecfile(%S)" f)) + (command + ;; IPython puts the FakeModule module into __main__ so + ;; emacs.eexecfile becomes useless. + (if (string-match "^ipython" python-command) + (format "execfile %S" f) + (format "emacs.eexecfile(%S)" f))) (orig-start (copy-marker start))) (when (save-excursion (goto-char start) @@ -1823,7 +1869,9 @@ information etc. If PROC is non-nil, check the buffer for that process." (with-current-buffer (process-buffer (or proc (python-proc))) (save-excursion - (save-match-data (re-search-backward ">>> \\=" nil t))))) + (save-match-data + (re-search-backward (concat python--prompt-regexp " *\\=") + nil t))))) ;; Fixme: Is there anything reasonable we can do with random methods? ;; (Currently only works with functions.) @@ -2539,9 +2587,7 @@ "Watch output for Python prompt and exec next file waiting in queue. This function is appropriate for `comint-output-filter-functions'." ;; TBD: this should probably use split-string - (when (and (or (string-equal string ">>> ") - (and (>= (length string) 5) - (string-equal (substring string -5) "\n>>> "))) + (when (and (string-match python--prompt-regexp string) python-file-queue) (condition-case nil (delete-file (car python-file-queue)) @@ -2753,6 +2799,7 @@ (funcall (process-filter proc) proc msg)) (set-buffer curbuf)) (process-send-string proc cmd))) + ;;;###autoload (defun python-shell (&optional argprompt) "Start an interactive Python interpreter in another window. @@ -2792,6 +2839,7 @@ non-Python process buffers using the default (Emacs-supplied) process filter." (interactive "P") + (require 'ansi-color) ; For ipython ;; Set the default shell if not already set (when (null python-which-shell) (python-toggle-shells python-default-interpreter)) @@ -2808,10 +2856,9 @@ )))) (switch-to-buffer-other-window (apply 'make-comint python-which-bufname python-which-shell nil args)) - (make-local-variable 'comint-prompt-regexp) (set-process-sentinel (get-buffer-process (current-buffer)) 'python-sentinel) - (setq comint-prompt-regexp "^>>> \\|^[.][.][.] \\|^(pdb) ") + (python--set-prompt-regexp) (add-hook 'comint-output-filter-functions 'python-comint-output-filter-function nil t) ;; pdbtrack ------------------------------------------------------------ revno: 101176 committer: Chong Yidong branch nick: trunk timestamp: Tue 2010-08-24 11:48:14 -0400 message: Avoid clobbering primary selection when switching frames (Bug#6872). * lisp/mouse.el (mouse-yank-primary): Avoid setting primary when deactivating the mark (Bug#6872). * src/keyboard.c (command_loop_1): Don't set primary selection during handle-switch-frame (Bug#6872). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-23 13:08:54 +0000 +++ lisp/ChangeLog 2010-08-24 15:48:14 +0000 @@ -1,3 +1,8 @@ +2010-08-24 Chong Yidong + + * mouse.el (mouse-yank-primary): Avoid setting primary when + deactivating the mark (Bug#6872). + 2010-08-23 Michael Albinus * net/dbus.el: Accept UNIX domain sockets as bus address. === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-08-21 04:46:23 +0000 +++ lisp/mouse.el 2010-08-24 15:48:14 +0000 @@ -1268,10 +1268,11 @@ (interactive "e") ;; Give temporary modes such as isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) + ;; Without this, confusing things happen upon e.g. inserting into + ;; the middle of an active region. (when select-active-regions - ;; Without this, confusing things happen upon e.g. inserting into - ;; the middle of an active region. - (deactivate-mark)) + (let (select-active-regions) + (deactivate-mark))) (or mouse-yank-at-point (mouse-set-point click)) (let ((primary (cond === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-23 13:02:00 +0000 +++ src/ChangeLog 2010-08-24 15:48:14 +0000 @@ -1,3 +1,8 @@ +2010-08-24 Chong Yidong + + * keyboard.c (command_loop_1): Don't clobber primary selection + during handle-switch-frame (Bug#6872). + 2010-08-23 Michael Albinus * dbusbind.c: Accept UNIX domain sockets as bus address. === modified file 'src/keyboard.c' --- src/keyboard.c 2010-08-22 23:27:59 +0000 +++ src/keyboard.c 2010-08-24 15:48:14 +0000 @@ -368,7 +368,7 @@ Used by the `select-active-regions' feature. */ Lisp_Object Vsaved_region_selection; -Lisp_Object Qx_set_selection, QPRIMARY; +Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame; Lisp_Object Qself_insert_command; Lisp_Object Qforward_char; @@ -1799,10 +1799,11 @@ { /* Even if not deactivating the mark, set PRIMARY if `select-active-regions' is non-nil. */ - if (EQ (Vselect_active_regions, Qonly) - ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) - : (!NILP (Vselect_active_regions) - && !NILP (Vtransient_mark_mode))) + if ((EQ (Vselect_active_regions, Qonly) + ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) + : (!NILP (Vselect_active_regions) + && !NILP (Vtransient_mark_mode))) + && !EQ (Vthis_command, Qhandle_switch_frame)) { int beg = XINT (Fmarker_position (current_buffer->mark)); int end = XINT (make_number (PT)); @@ -11702,6 +11703,8 @@ staticpro (&Qx_set_selection); QPRIMARY = intern_c_string ("PRIMARY"); staticpro (&QPRIMARY); + Qhandle_switch_frame = intern_c_string ("handle-switch-frame"); + staticpro (&Qhandle_switch_frame); Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char"); staticpro (&Qinput_method_exit_on_first_char); ------------------------------------------------------------ revno: 101175 committer: Michael Albinus branch nick: trunk timestamp: Mon 2010-08-23 15:57:55 +0200 message: * NEWS: dbus.el supports alternative buses. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-08-14 08:46:48 +0000 +++ etc/ChangeLog 2010-08-23 13:57:55 +0000 @@ -1,3 +1,7 @@ +2010-08-23 Michael Albinus + + * NEWS: dbus.el supports alternative buses. + 2010-08-14 Eli Zaretskii * tutorials/TUTORIAL.he: Use MAQAF instead of hyphen where appropriate. === modified file 'etc/NEWS' --- etc/NEWS 2010-08-22 21:15:20 +0000 +++ etc/NEWS 2010-08-23 13:57:55 +0000 @@ -413,6 +413,11 @@ supports multithread non-stop debugging and debugging of several threads simultaneously. +** D-Bus + +*** It is possible now, to access alternative buses than the default +system or session bus. + * New Modes and Packages in Emacs 24.1 ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.