Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103659. ------------------------------------------------------------ revno: 103659 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-03-14 22:46:18 -0400 message: * lisp/allout.el (allout-abbreviate-flattened-numbering) (allout-mode-deactivate-hook): Fix up obsolescence "date". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-15 02:42:31 +0000 +++ lisp/ChangeLog 2011-03-15 02:46:18 +0000 @@ -1,5 +1,8 @@ 2011-03-15 Stefan Monnier + * allout.el (allout-abbreviate-flattened-numbering) + (allout-mode-deactivate-hook): Fix up obsolescence "date". + * subr.el (read-char-choice): Only show the cursor after the prompt, not after the answer. === modified file 'lisp/allout.el' --- lisp/allout.el 2011-03-09 20:48:56 +0000 +++ lisp/allout.el 2011-03-15 02:46:18 +0000 @@ -310,6 +310,7 @@ With value nil, inhibit any automatic allout-mode activation." :set 'allout-auto-activation-helper + ;; FIXME: Using strings here is unusual and less efficient than symbols. :type '(choice (const :tag "On" t) (const :tag "Ask about layout" "ask") (const :tag "Mode only" "activate") @@ -752,7 +753,7 @@ ;;;_ = allout-flattened-numbering-abbreviation (define-obsolete-variable-alias 'allout-abbreviate-flattened-numbering - 'allout-flattened-numbering-abbreviation "24.0") + 'allout-flattened-numbering-abbreviation "24.1") (defcustom allout-flattened-numbering-abbreviation nil "If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic numbers to minimal amount with some context. Otherwise, entire @@ -1402,7 +1403,7 @@ (defvar allout-mode-deactivate-hook nil "*Hook that's run when allout mode ends.") (define-obsolete-variable-alias 'allout-mode-deactivate-hook - 'allout-mode-off-hook "future") + 'allout-mode-off-hook "24.1") ;;;_ = allout-exposure-category (defvar allout-exposure-category nil "Symbol for use as allout invisible-text overlay category.") ------------------------------------------------------------ revno: 103658 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-03-14 22:44:17 -0400 message: * lisp/gnus/auth-source.el (auth-source-netrc-create): Use usual format for the default in prompts. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-03-13 20:50:07 +0000 +++ lisp/gnus/ChangeLog 2011-03-15 02:44:17 +0000 @@ -1,3 +1,8 @@ +2011-03-15 Stefan Monnier + + * auth-source.el (auth-source-netrc-create): Use usual format for the + default in prompts. + 2011-03-13 Teodor Zlatanov * auth-source.el (auth-source-netrc-create): Show the default in the @@ -15,9 +20,9 @@ 2011-03-11 Teodor Zlatanov - * gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook): Don't - install `gnus-sync-read' to any hooks by default. It's buggy. The - user will have to run `gnus-sync-read' manually and wait for Cloudy + * gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook): + Don't install `gnus-sync-read' to any hooks by default. It's buggy. + The user will have to run `gnus-sync-read' manually and wait for Cloudy Gnus. 2011-03-11 Julien Danjou @@ -101,8 +106,8 @@ 2011-03-05 Antoine Levitt - * message.el (message-cite-reply-position, message-cite-style): New - variables. + * message.el (message-cite-reply-position, message-cite-style): + New variables. (message-yank-original): Use the new citation styles. 2011-03-04 Daiki Ueno @@ -216,14 +221,14 @@ 2011-02-23 Lars Ingebrigtsen - * gnus-start.el (gnus-dribble-read-file): Set - buffer-save-without-query, since we always want to save the dribble + * gnus-start.el (gnus-dribble-read-file): + Set buffer-save-without-query, since we always want to save the dribble file, probably. * nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. - * gnus-sum.el (gnus-user-date-format-alist): Renamed back again from + * gnus-sum.el (gnus-user-date-format-alist): Rename back again from -summary- since it's a user-visible variable. * nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the @@ -469,8 +474,8 @@ 2011-02-14 Teodor Zlatanov * auth-source.el (auth-source-backend-parse-parameters): Don't rely on - `plist-get' to accept non-list parameters (XEmacs issue). Fix - docstring. + `plist-get' to accept non-list parameters (XEmacs issue). + Fix docstring. (auth-source-secrets-search): Use `delete-dups', `append mapcar', and `butlast' instead of `remove-duplicates', `mapcan', and `subseq'. (auth-sources, auth-source-backend-parse, auth-source-secrets-search): @@ -510,8 +515,8 @@ 2011-02-13 Tassilo Horn (tiny change) - * nnimap.el (nnimap-request-accept-article, nnimap-process-quirk): Fix - Gcc processing on imap. + * nnimap.el (nnimap-request-accept-article, nnimap-process-quirk): + Fix Gcc processing on imap. 2011-02-10 Stefan Monnier @@ -599,8 +604,8 @@ 2011-02-06 Michael Albinus - * auth-source.el (top): Require 'eieio unconditionally. Autoload - `secrets-get-attributes' instead of `secrets-get-attribute'. + * auth-source.el (top): Require 'eieio unconditionally. + Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. @@ -636,7 +641,7 @@ (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) - (auth-source-user-or-password-smtp): Removed. + (auth-source-user-or-password-smtp): Remove. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. @@ -802,16 +807,16 @@ * gnus-group.el (gnus-group-jump-to-group): Allow jumping to groups that Gnus doesn't know exists again. - * gnus-art.el (gnus-article-date-lapsed-new-header): Removed. + * gnus-art.el (gnus-article-date-lapsed-new-header): Remove. (gnus-treat-date-ut): Ditto. - (gnus-article-update-date-header): Renamed. - (gnus-treat-date-local): Removed. - (gnus-treat-date-english): Removed. - (gnus-treat-date-lapsed): Removed. - (gnus-treat-date-combined-lapsed): Removed. - (gnus-treat-date-original): Removed. - (gnus-treat-date-iso8601): Removed. - (gnus-treat-date-user-defined): Removed. + (gnus-article-update-date-header): Rename. + (gnus-treat-date-local): Remove. + (gnus-treat-date-english): Remove. + (gnus-treat-date-lapsed): Remove. + (gnus-treat-date-combined-lapsed): Remove. + (gnus-treat-date-original): Remove. + (gnus-treat-date-iso8601): Remove. + (gnus-treat-date-user-defined): Remove. (gnus-article-date-headers): New variable to control all the date header options. (article-date-ut): Rewrite to allow using the new way to format date === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-03-13 20:50:07 +0000 +++ lisp/gnus/auth-source.el 2011-03-15 02:44:17 +0000 @@ -1093,17 +1093,19 @@ (?h ,(aget printable-defaults 'host)) (?p ,(aget printable-defaults 'port)))))) - ;; store the data, prompting for the password if needed + ;; Store the data, prompting for the password if needed. (setq data (cond ((and (null data) (eq r 'secret)) - ;; special case prompt for passwords + ;; Special case prompt for passwords. (read-passwd prompt)) ((null data) (when default - (setq - prompt - (concat prompt (format "(default %s) " default)))) + (setq prompt + (if (string-match ": *\\'" prompt) + (concat (substring prompt 0 (match-beginning 0)) + " (default " default "): ") + (concat prompt "(default " default ") ")))) (read-string prompt nil nil default)) (t (or data default)))) @@ -1115,7 +1117,7 @@ (lambda () data)) data)))) - ;; when r is not an empty string... + ;; When r is not an empty string... (when (and (stringp data) (< 0 (length data))) ;; this function is not strictly necessary but I think it @@ -1173,7 +1175,7 @@ ;; we want the new data to be found first, so insert at beginning (goto-char (point-min)) - ;; ask AFTER we've successfully opened the file + ;; Ask AFTER we've successfully opened the file. (let ((prompt (format "Save auth info to file %s? " file)) (done (not (eq auth-source-save-behavior 'ask))) (bufname "*auth-source Help*") @@ -1190,6 +1192,8 @@ "(N)o and don't ask to save again\n" "(e)dit the line\n" "(?) for help as you can see.\n")) + ;; Why? Doesn't with-output-to-temp-buffer already do + ;; the exact same thing anyway? --Stef (set-buffer standard-output) (help-mode)))) (?n (setq add "" @@ -1203,7 +1207,7 @@ (when (get-buffer-window bufname) (delete-window (get-buffer-window bufname))) - ;; make sure the info is not saved + ;; Make sure the info is not saved. (when (null auth-source-save-behavior) (setq add "")) ------------------------------------------------------------ revno: 103657 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-03-14 22:42:31 -0400 message: * lisp/subr.el (read-char-choice): Only show the cursor after the prompt, not after the answer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-15 02:36:07 +0000 +++ lisp/ChangeLog 2011-03-15 02:42:31 +0000 @@ -1,3 +1,8 @@ +2011-03-15 Stefan Monnier + + * subr.el (read-char-choice): Only show the cursor after the prompt, + not after the answer. + 2011-03-15 Kevin Ryde * help-fns.el (variable-at-point): Skip leading quotes, if any === modified file 'lisp/subr.el' --- lisp/subr.el 2011-02-01 21:37:12 +0000 +++ lisp/subr.el 2011-03-15 02:42:31 +0000 @@ -2003,24 +2003,24 @@ keyboard-quit events while waiting for a valid input." (unless (consp chars) (error "Called `read-char-choice' without valid char choices")) - (let ((cursor-in-echo-area t) - (executing-kbd-macro executing-kbd-macro) - char done) - (while (not done) - (unless (get-text-property 0 'face prompt) - (setq prompt (propertize prompt 'face 'minibuffer-prompt))) - (setq char (let ((inhibit-quit inhibit-keyboard-quit)) - (read-key prompt))) - (cond - ((not (numberp char))) - ((memq char chars) - (setq done t)) - ((and executing-kbd-macro (= char -1)) - ;; read-event returns -1 if we are in a kbd macro and - ;; there are no more events in the macro. Attempt to - ;; get an event interactively. - (setq executing-kbd-macro nil)))) - ;; Display the question with the answer. + (let (char done) + (let ((cursor-in-echo-area t) + (executing-kbd-macro executing-kbd-macro)) + (while (not done) + (unless (get-text-property 0 'face prompt) + (setq prompt (propertize prompt 'face 'minibuffer-prompt))) + (setq char (let ((inhibit-quit inhibit-keyboard-quit)) + (read-key prompt))) + (cond + ((not (numberp char))) + ((memq char chars) + (setq done t)) + ((and executing-kbd-macro (= char -1)) + ;; read-event returns -1 if we are in a kbd macro and + ;; there are no more events in the macro. Attempt to + ;; get an event interactively. + (setq executing-kbd-macro nil))))) + ;; Display the question with the answer. But without cursor-in-echo-area. (message "%s%s" prompt (char-to-string char)) char)) ------------------------------------------------------------ revno: 103656 author: Kevin Ryde committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-03-14 22:36:07 -0400 message: * lisp/help-fns.el (variable-at-point): Skip leading quotes, if any (bug#8253). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-15 01:12:54 +0000 +++ lisp/ChangeLog 2011-03-15 02:36:07 +0000 @@ -1,3 +1,8 @@ +2011-03-15 Kevin Ryde + + * help-fns.el (variable-at-point): Skip leading quotes, if any + (bug#8253). + 2011-03-15 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-save-excursion): Change the === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2011-03-12 19:19:47 +0000 +++ lisp/help-fns.el 2011-03-15 02:36:07 +0000 @@ -534,6 +534,7 @@ (with-syntax-table emacs-lisp-mode-syntax-table (or (condition-case () (save-excursion + (skip-chars-forward "'") (or (not (zerop (skip-syntax-backward "_w"))) (eq (char-syntax (following-char)) ?w) (eq (char-syntax (following-char)) ?_) ------------------------------------------------------------ revno: 103655 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-03-14 21:12:54 -0400 message: * lisp/emacs-lisp/bytecomp.el (byte-compile-save-excursion): Change the warning message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-14 09:53:13 +0000 +++ lisp/ChangeLog 2011-03-15 01:12:54 +0000 @@ -1,3 +1,8 @@ +2011-03-15 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compile-save-excursion): Change the + warning message. + 2011-03-14 Michael Albinus * shell.el (shell): When called interactively, offer to change the === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2011-03-12 02:59:24 +0000 +++ lisp/emacs-lisp/bytecomp.el 2011-03-15 01:12:54 +0000 @@ -3776,7 +3776,8 @@ (defun byte-compile-save-excursion (form) (if (and (eq 'set-buffer (car-safe (car-safe (cdr form)))) (byte-compile-warning-enabled-p 'suspicious)) - (byte-compile-warn "`save-excursion' defeated by `set-buffer'")) + (byte-compile-warn + "Use `with-current-buffer' rather than save-excursion+set-buffer")) (byte-compile-out 'byte-save-excursion 0) (byte-compile-body-do-effect (cdr form)) (byte-compile-out 'byte-unbind 1)) ------------------------------------------------------------ revno: 103654 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2011-03-14 18:22:53 +0100 message: src/ChangeLog: Fix typos. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-14 17:07:53 +0000 +++ src/ChangeLog 2011-03-14 17:22:53 +0000 @@ -6,7 +6,7 @@ (w32_system_caret_x, w32_system_caret_y): Declare extern. * w32select.c: Don't #include "keyboard.h". - (run_protected): Add extern declaration for waiting_for_input. + (run_protected): Add extern declaration for waiting_for_input. * w32.c (Qlocal, noninteractive1, inhibit_window_system): * w32console.c (detect_input_pending, read_input_pending) @@ -25,7 +25,7 @@ 2011-03-14 Chong Yidong - * buffer.c (Fmake_indirect_buffer): Fix incorrect assertion. + * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions. 2011-03-13 Chong Yidong @@ -130,7 +130,7 @@ 2011-03-12 Eli Zaretskii - * termcap.c [MSDOS]: Include "msdos.h. + * termcap.c [MSDOS]: Include "msdos.h". (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent): Constify `char *' arguments and their references according to prototypes in tparam.h. ------------------------------------------------------------ revno: 103653 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2011-03-14 18:07:53 +0100 message: src/w32*.c: Clean up extern declarations. * w32select.c: Don't #include "keyboard.h". (run_protected): Add extern declaration for waiting_for_input. * lisp.h (VWindow_system, Qfile_name_history): * keyboard.h (lispy_function_keys) [WINDOWSNT]: * w32term.h (w32_system_caret_hwnd, w32_system_caret_height) (w32_system_caret_x, w32_system_caret_y): Declare extern. * w32.c (Qlocal, noninteractive1, inhibit_window_system): * w32console.c (detect_input_pending, read_input_pending) (encode_terminal_code): * w32fns.c (quit_char, lispy_function_keys, Qtooltip) (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x) (w32_system_caret_y, Qfile_name_history): * w32font.c (w32font_driver, QCantialias, QCotf, QClang): * w32inevt.c (reinvoke_input_signal, lispy_function_keys): * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map) (Qoverriding_terminal_local_map, Qmenu_bar_update_hook): * w32proc.c (Qlocal, report_file_error): * w32term.c (Vwindow_system, updating_frame): * w32uniscribe.c (initialized, uniscribe_font_driver): Remove unneeded extern declarations. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-14 16:18:25 +0000 +++ src/ChangeLog 2011-03-14 17:07:53 +0000 @@ -1,3 +1,28 @@ +2011-03-14 Juanma Barranquero + + * lisp.h (VWindow_system, Qfile_name_history): + * keyboard.h (lispy_function_keys) [WINDOWSNT]: + * w32term.h (w32_system_caret_hwnd, w32_system_caret_height) + (w32_system_caret_x, w32_system_caret_y): Declare extern. + + * w32select.c: Don't #include "keyboard.h". + (run_protected): Add extern declaration for waiting_for_input. + + * w32.c (Qlocal, noninteractive1, inhibit_window_system): + * w32console.c (detect_input_pending, read_input_pending) + (encode_terminal_code): + * w32fns.c (quit_char, lispy_function_keys, Qtooltip) + (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x) + (w32_system_caret_y, Qfile_name_history): + * w32font.c (w32font_driver, QCantialias, QCotf, QClang): + * w32inevt.c (reinvoke_input_signal, lispy_function_keys): + * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map) + (Qoverriding_terminal_local_map, Qmenu_bar_update_hook): + * w32proc.c (Qlocal, report_file_error): + * w32term.c (Vwindow_system, updating_frame): + * w32uniscribe.c (initialized, uniscribe_font_driver): + Remove unneeded extern declarations. + 2011-03-14 Chong Yidong * buffer.c (Fmake_indirect_buffer): Fix incorrect assertion. === modified file 'src/keyboard.h' --- src/keyboard.h 2011-02-16 16:35:16 +0000 +++ src/keyboard.h 2011-03-14 17:07:53 +0000 @@ -90,7 +90,7 @@ /* User-supplied table to translate input characters through. */ Lisp_Object KBOARD_INTERNAL_FIELD (Vkeyboard_translate_table); - + /* Last command that may be repeated by `repeat'. */ Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_repeatable_command); @@ -140,12 +140,12 @@ /* Keymap mapping keys to alternative preferred forms. See the DEFVAR for more documentation. */ Lisp_Object KBOARD_INTERNAL_FIELD (Vlocal_function_key_map); - + /* Keymap mapping ASCII function key sequences onto their preferred forms. Initialized by the terminal-specific lisp files. See the DEFVAR for more documentation. */ Lisp_Object KBOARD_INTERNAL_FIELD (Vinput_decode_map); - + /* Minibufferless frames on this display use this frame's minibuffer. */ Lisp_Object KBOARD_INTERNAL_FIELD (Vdefault_minibuffer_frame); @@ -518,3 +518,6 @@ struct input_event *); extern EMACS_TIME timer_check (int); +#ifdef WINDOWSNT +extern const char *const lispy_function_keys[]; +#endif === modified file 'src/lisp.h' --- src/lisp.h 2011-03-10 02:01:53 +0000 +++ src/lisp.h 2011-03-14 17:07:53 +0000 @@ -2607,6 +2607,7 @@ /* Defined in dispnew.c */ extern Lisp_Object selected_frame; +extern Lisp_Object Vwindow_system; EXFUN (Fding, 1); EXFUN (Fredraw_frame, 1); EXFUN (Fsleep_for, 2); @@ -3009,6 +3010,7 @@ extern Lisp_Object Qfile_exists_p; extern Lisp_Object Qfile_directory_p; extern Lisp_Object Qinsert_file_contents; +extern Lisp_Object Qfile_name_history; EXFUN (Ffind_file_name_handler, 2); EXFUN (Ffile_name_as_directory, 1); EXFUN (Fexpand_file_name, 2); === modified file 'src/w32.c' --- src/w32.c 2011-02-27 19:48:31 +0000 +++ src/w32.c 2011-03-14 17:07:53 +0000 @@ -147,9 +147,6 @@ void globals_of_w32 (void); static DWORD get_rid (PSID); -/* Defined in process.c for its own purpose. */ -extern Lisp_Object Qlocal; - /* Initialization states. @@ -5666,8 +5663,6 @@ static void check_windows_init_file (void) { - extern int noninteractive, inhibit_window_system; - /* A common indication that Emacs is not installed properly is when it cannot find the Windows installation file. If this file does not exist in the expected place, tell the user. */ === modified file 'src/w32console.c' --- src/w32console.c 2011-01-25 04:08:28 +0000 +++ src/w32console.c 2011-03-14 17:07:53 +0000 @@ -41,12 +41,6 @@ /* from window.c */ extern Lisp_Object Frecenter (Lisp_Object); -/* from keyboard.c */ -extern int detect_input_pending (void); - -/* from sysdep.c */ -extern int read_input_pending (void); - static void w32con_move_cursor (struct frame *f, int row, int col); static void w32con_clear_to_end (struct frame *f); static void w32con_clear_frame (struct frame *f); @@ -277,9 +271,6 @@ } } -extern unsigned char *encode_terminal_code (struct glyph *, int, - struct coding_system *); - static void w32con_write_glyphs (struct frame *f, register struct glyph *string, register int len) === modified file 'src/w32fns.c' --- src/w32fns.c 2011-03-07 21:11:24 +0000 +++ src/w32fns.c 2011-03-14 17:07:53 +0000 @@ -80,10 +80,6 @@ extern void w32_free_menu_strings (HWND); extern const char *map_w32_filename (const char *, const char **); -extern int quit_char; - -extern const char *const lispy_function_keys[]; - /* If non-zero, a w32 timer that, when it expires, displays an hourglass cursor on all frames. */ static unsigned hourglass_timer = 0; @@ -187,18 +183,10 @@ #define MENU_FREE_DELAY 1000 static unsigned menu_free_timer = 0; -extern Lisp_Object Qtooltip; - #ifdef GLYPH_DEBUG int image_cache_refcount, dpyinfo_refcount; #endif - -extern HWND w32_system_caret_hwnd; - -extern int w32_system_caret_height; -extern int w32_system_caret_x; -extern int w32_system_caret_y; static HWND w32_visible_system_caret_hwnd; /* From w32menu.c */ @@ -5851,7 +5839,6 @@ /*********************************************************************** File selection dialog ***********************************************************************/ -extern Lisp_Object Qfile_name_history; /* Callback for altering the behavior of the Open File dialog. Makes the Filename text field contain "Current Directory" and be @@ -5899,7 +5886,7 @@ no man's land and the user will be unable to tab through the dialog box (pressing tab will only result in a beep). Avoid that problem by setting focus to the list here. */ - if (CDN_INITDONE == notify->hdr.code) + if (notify->hdr.code == CDN_INITDONE) SetFocus (list); } else === modified file 'src/w32font.c' --- src/w32font.c 2011-01-25 04:08:28 +0000 +++ src/w32font.c 2011-03-14 17:07:53 +0000 @@ -54,8 +54,6 @@ #define JOHAB_CHARSET 130 #endif -extern struct font_driver w32font_driver; - Lisp_Object Qgdi; Lisp_Object Quniscribe; static Lisp_Object QCformat; @@ -64,7 +62,6 @@ static Lisp_Object Qraster, Qoutline, Qunknown; /* antialiasing */ -extern Lisp_Object QCantialias, QCotf, QClang; /* defined in font.c */ extern Lisp_Object Qnone; /* reuse from w32fns.c */ static Lisp_Object Qstandard, Qsubpixel, Qnatural; === modified file 'src/w32inevt.c' --- src/w32inevt.c 2011-01-25 04:08:28 +0000 +++ src/w32inevt.c 2011-03-14 17:07:53 +0000 @@ -40,18 +40,15 @@ #include "w32heap.h" #include "w32term.h" -/* stdin, from ntterm */ +/* stdin, from w32console.c */ extern HANDLE keyboard_handle; /* Info for last mouse motion */ static COORD movement_pos; static DWORD movement_time; -/* from keyboard.c */ -extern void reinvoke_input_signal (void); - +/* from w32fns.c */ extern unsigned int map_keypad_keys (unsigned int, unsigned int); - extern unsigned int w32_key_to_modifier (int key); /* Event queue */ @@ -261,8 +258,6 @@ } -extern const char *const lispy_function_keys[]; - static int faked_key = 0; /* return code -1 means that event_queue_ptr won't be incremented. === modified file 'src/w32menu.c' --- src/w32menu.c 2011-01-25 04:08:28 +0000 +++ src/w32menu.c 2011-03-14 17:07:53 +0000 @@ -84,14 +84,6 @@ Lisp_Object Qdebug_on_next_call; -extern Lisp_Object Qmenu_bar; - -extern Lisp_Object QCtoggle, QCradio; - -extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; - -extern Lisp_Object Qmenu_bar_update_hook; - void set_frame_menubar (FRAME_PTR, int, int); #ifdef HAVE_DIALOGS === modified file 'src/w32proc.c' --- src/w32proc.c 2011-02-28 01:07:29 +0000 +++ src/w32proc.c 2011-03-14 17:07:53 +0000 @@ -67,8 +67,6 @@ + ((DWORD)(var) - (section)->VirtualAddress) \ + (filedata).file_base)) -extern Lisp_Object Qlocal; - Lisp_Object Qhigh, Qlow; #ifdef EMACSDEBUG @@ -1053,7 +1051,7 @@ detect that we were woken up by C-g, we return -1 with errno set to EINTR as on Unix. */ -/* From ntterm.c */ +/* From w32console.c */ extern HANDLE keyboard_handle; /* From w32xfns.c */ @@ -1559,8 +1557,6 @@ return rc; } -/* extern int report_file_error (char *, Lisp_Object); */ - /* The following two routines are used to manipulate stdin, stdout, and stderr of our child processes. @@ -1660,7 +1656,7 @@ dial-up users to only be connected when they actually need to use socket services. */ -/* From nt.c */ +/* From w32.c */ extern HANDLE winsock_lib; extern BOOL term_winsock (void); extern BOOL init_winsock (int load_now); === modified file 'src/w32select.c' --- src/w32select.c 2011-01-25 04:08:28 +0000 +++ src/w32select.c 2011-03-14 17:07:53 +0000 @@ -78,7 +78,6 @@ #include "w32term.h" /* for all of the w32 includes */ #include "w32heap.h" /* os_subtype */ #include "blockinput.h" -#include "keyboard.h" /* cmd_error_internal() */ #include "charset.h" #include "coding.h" #include "character.h" @@ -391,6 +390,7 @@ with global variables and calling strange looking functions. Is this really the right way to run Lisp callbacks? */ + extern int waiting_for_input; /* from keyboard.c */ int owfi; BLOCK_INPUT; === modified file 'src/w32term.c' --- src/w32term.c 2011-02-28 01:07:29 +0000 +++ src/w32term.c 2011-03-14 17:07:53 +0000 @@ -88,8 +88,6 @@ extern int w32_codepage_for_font (char *fontname); extern Cursor w32_load_cursor (LPCTSTR name); -extern Lisp_Object Vwindow_system; - #define x_any_window_to_frame x_window_to_frame #define x_top_window_to_frame x_window_to_frame @@ -138,13 +136,6 @@ #define WS_EX_LAYERED 0x80000 #endif -/* Frame being updated by update_frame. This is declared in term.c. - This is set by update_begin and looked at by all the - w32 functions. It is zero while not inside an update. - In that case, the w32 functions assume that `SELECTED_FRAME ()' - is the frame to apply to. */ -extern struct frame *updating_frame; - /* This is a frame waiting to be autoraised, within w32_read_socket. */ struct frame *pending_autoraise_frame; @@ -2536,8 +2527,7 @@ } -/* Clear entire frame. If updating_frame is non-null, clear that - frame. Otherwise clear the selected frame. */ +/* Clear entire frame. */ static void x_clear_frame (struct frame *f) @@ -6060,7 +6050,7 @@ terminal->mouse_position_hook = w32_mouse_position; terminal->frame_rehighlight_hook = w32_frame_rehighlight; terminal->frame_raise_lower_hook = w32_frame_raise_lower; - // terminal->fullscreen_hook = XTfullscreen_hook; + /* terminal->fullscreen_hook = XTfullscreen_hook; */ terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars; terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar; === modified file 'src/w32term.h' --- src/w32term.h 2011-01-25 04:08:28 +0000 +++ src/w32term.h 2011-03-14 17:07:53 +0000 @@ -547,7 +547,7 @@ #define WM_APPCOMMAND 0x319 #define GET_APPCOMMAND_LPARAM(lParam) (HIWORD(lParam) & 0x7fff) #endif -#ifndef WM_UNICHAR +#ifndef WM_UNICHAR #define WM_UNICHAR 0x109 #endif #ifndef UNICODE_NOCHAR @@ -697,3 +697,7 @@ IN UINT_PTR, IN LPCWSTR); +extern HWND w32_system_caret_hwnd; +extern int w32_system_caret_height; +extern int w32_system_caret_x; +extern int w32_system_caret_y; === modified file 'src/w32uniscribe.c' --- src/w32uniscribe.c 2011-01-25 04:08:28 +0000 +++ src/w32uniscribe.c 2011-03-14 17:07:53 +0000 @@ -52,10 +52,6 @@ extern Lisp_Object Quniscribe; extern Lisp_Object Qopentype; -extern int initialized; - -extern struct font_driver uniscribe_font_driver; - /* EnumFontFamiliesEx callback. */ static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *, NEWTEXTMETRICEX *, ------------------------------------------------------------ revno: 103652 committer: Michael Albinus branch nick: trunk timestamp: Mon 2011-03-14 17:39:58 +0100 message: * tramp.texi (Remote processes): New subsection "Running shell on a remote host". diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-03-13 04:07:38 +0000 +++ doc/misc/ChangeLog 2011-03-14 16:39:58 +0000 @@ -1,3 +1,8 @@ +2011-03-14 Michael Albinus + + * tramp.texi (Remote processes): New subsection "Running shell on + a remote host". + 2011-03-12 Teodor Zlatanov * auth.texi (Help for developers): Update docs to explain that the === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2011-03-12 19:19:47 +0000 +++ doc/misc/tramp.texi 2011-03-14 16:39:58 +0000 @@ -2540,7 +2540,28 @@ that host. -@subsection Running shell-command on a remote host +@subsection Running @code{shell} on a remote host +@cindex shell + +Calling @code{M-x shell} in a buffer related to a remote host runs the +local shell as defined in @option{shell-file-name}. This might be +also a valid path name for a shell to be applied on the remote host, +but it will fail at least when your local and remote hosts belong to +different system types, like @samp{windows-nt} and @samp{gnu/linux}. + +You must set the variable @option{explicit-shell-file-name} to the +shell path name on the remote host, in order to start that shell on +the remote host. + +@ifset emacs +Starting with Emacs 24 this won't be necessary, if you call +@code{shell} interactively. You will be asked for the remote shell +path, if you are on a remote buffer, and if +@option{explicit-shell-file-name} is equal to @code{nil}. +@end ifset + + +@subsection Running @code{shell-command} on a remote host @cindex shell-command @code{shell-command} allows to execute commands in a shell, either @@ -2556,13 +2577,13 @@ continuous output of the @command{tail} command. -@subsection Running eshell on a remote host +@subsection Running @code{eshell} on a remote host @cindex eshell @value{tramp} is integrated into @file{eshell.el}. That is, you can open an interactive shell on your remote host, and run commands there. -After you have started @code{eshell}, you could perform commands like -this: +After you have started @code{M-x eshell}, you could perform commands +like this: @example @b{~ $} cd @trampfn{sudo, , , /etc} @key{RET} ------------------------------------------------------------ revno: 103651 committer: Chong Yidong branch nick: trunk timestamp: Mon 2011-03-14 12:18:25 -0400 message: * src/buffer.c (Fmake_indirect_buffer): Fix incorrect assertion. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-13 22:25:16 +0000 +++ src/ChangeLog 2011-03-14 16:18:25 +0000 @@ -1,3 +1,7 @@ +2011-03-14 Chong Yidong + + * buffer.c (Fmake_indirect_buffer): Fix incorrect assertion. + 2011-03-13 Chong Yidong * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT) === modified file 'src/buffer.c' --- src/buffer.c 2011-03-13 22:25:16 +0000 +++ src/buffer.c 2011-03-14 16:18:25 +0000 @@ -611,8 +611,8 @@ /* Make sure the base buffer has markers for its narrowing. */ if (NILP (BVAR (b->base_buffer, pt_marker))) { - eassert (NILP (BVAR (b, begv_marker))); - eassert (NILP (BVAR (b, zv_marker))); + eassert (NILP (BVAR (b->base_buffer, begv_marker))); + eassert (NILP (BVAR (b->base_buffer, zv_marker))); BVAR (b->base_buffer, pt_marker) = Fmake_marker (); set_marker_both (BVAR (b->base_buffer, pt_marker), base_buffer, ------------------------------------------------------------ revno: 103650 committer: Michael Albinus branch nick: trunk timestamp: Mon 2011-03-14 15:13:40 +0100 message: * NEWS: `shell' prompts for the shell path name, when the default directory is a remote file name and neither environment variable $ESHELL nor variable `explicit-shell-file-name' is set. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2011-03-12 19:19:47 +0000 +++ etc/ChangeLog 2011-03-14 14:13:40 +0000 @@ -1,3 +1,9 @@ +2011-03-14 Michael Albinus + + * NEWS: `shell' prompts for the shell path name, when the default + directory is a remote file name and neither environment variable + $ESHELL nor variable `explicit-shell-file-name' is set. + 2011-03-08 Kristoffer Grönlund * themes/wombat-theme.el: New file. === modified file 'etc/NEWS' --- etc/NEWS 2011-03-07 07:37:02 +0000 +++ etc/NEWS 2011-03-14 14:13:40 +0000 @@ -335,6 +335,10 @@ the lines in the current rectangle. With an prefix argument, this prompts for a number to count from and for a format string. +** The command shell prompts for the shell path name, when the default +directory is a remote file name and neither environment variable +$ESHELL nor variable `explicit-shell-file-name' is set. + * Changes in Specialized Modes and Packages in Emacs 24.1 ------------------------------------------------------------ revno: 103649 committer: Michael Albinus branch nick: trunk timestamp: Mon 2011-03-14 10:53:13 +0100 message: * shell.el (shell): When called interactively, offer to change the shell file name on remote hosts. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-13 22:17:17 +0000 +++ lisp/ChangeLog 2011-03-14 09:53:13 +0000 @@ -1,3 +1,8 @@ +2011-03-14 Michael Albinus + + * shell.el (shell): When called interactively, offer to change the + shell file name on remote hosts. + 2011-03-13 Teodor Zlatanov * net/ldap.el (ldap-search-internal): Add `auth-source-search' === modified file 'lisp/shell.el' --- lisp/shell.el 2011-03-09 09:01:14 +0000 +++ lisp/shell.el 2011-03-14 09:53:13 +0000 @@ -583,6 +583,21 @@ (get-buffer-create (or buffer "*shell*")) ;; If the current buffer is a dead shell buffer, use it. (current-buffer))) + + ;; On remote hosts, the local `shell-file-name' might be useless. + (if (and (interactive-p) + (file-remote-p default-directory) + (null explicit-shell-file-name) + (null (getenv "ESHELL"))) + (with-current-buffer buffer + (set (make-local-variable 'explicit-shell-file-name) + (file-remote-p + (expand-file-name + (read-file-name + "Remote shell path: " default-directory shell-file-name + t shell-file-name)) + 'localname)))) + ;; Pop to buffer, so that the buffer's window will be correctly set ;; when we call comint (so that comint sets the COLUMNS env var properly). (pop-to-buffer buffer) ------------------------------------------------------------ revno: 103648 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-03-13 18:25:16 -0400 message: Fix BUF_* macros to handle indirect buffers properly (Bug#8219). * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT) (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219). These macros can no longer be used for assignment. * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Assign struct members directly, instead of using BUF_BEGV etc. (record_buffer_markers, fetch_buffer_markers): New functions for recording and fetching special buffer markers. (set_buffer_internal_1, set_buffer_temp): Use them. * lread.c (unreadchar): Use SET_BUF_PT_BOTH. * insdel.c (adjust_point): Use SET_BUF_PT_BOTH. * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH. (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH. * xdisp.c (hscroll_window_tree): (reconsider_clip_changes): Use PT instead of BUF_PT. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-13 17:49:38 +0000 +++ src/ChangeLog 2011-03-13 22:25:16 +0000 @@ -1,3 +1,25 @@ +2011-03-13 Chong Yidong + + * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT) + (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219). + These macros can no longer be used for assignment. + + * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Assign + struct members directly, instead of using BUF_BEGV etc. + (record_buffer_markers, fetch_buffer_markers): New functions for + recording and fetching special buffer markers. + (set_buffer_internal_1, set_buffer_temp): Use them. + + * lread.c (unreadchar): Use SET_BUF_PT_BOTH. + + * insdel.c (adjust_point): Use SET_BUF_PT_BOTH. + + * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH. + (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH. + + * xdisp.c (hscroll_window_tree): + (reconsider_clip_changes): Use PT instead of BUF_PT. + 2011-03-13 Eli Zaretskii * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on === modified file 'src/buffer.c' --- src/buffer.c 2011-03-11 16:49:16 +0000 +++ src/buffer.c 2011-03-13 22:25:16 +0000 @@ -330,15 +330,17 @@ if (! BUF_BEG_ADDR (b)) buffer_memory_full (); - BUF_PT (b) = BEG; + b->pt = BEG; + b->begv = BEG; + b->zv = BEG; + b->pt_byte = BEG_BYTE; + b->begv_byte = BEG_BYTE; + b->zv_byte = BEG_BYTE; + BUF_GPT (b) = BEG; - BUF_BEGV (b) = BEG; - BUF_ZV (b) = BEG; + BUF_GPT_BYTE (b) = BEG_BYTE; + BUF_Z (b) = BEG; - BUF_PT_BYTE (b) = BEG_BYTE; - BUF_GPT_BYTE (b) = BEG_BYTE; - BUF_BEGV_BYTE (b) = BEG_BYTE; - BUF_ZV_BYTE (b) = BEG_BYTE; BUF_Z_BYTE (b) = BEG_BYTE; BUF_MODIFF (b) = 1; BUF_CHARS_MODIFF (b) = 1; @@ -489,6 +491,53 @@ BVAR (to, local_var_alist) = buffer_lisp_local_variables (from); } + +/* If buffer B has markers to record PT, BEGV and ZV when it is not + current, update these markers. */ + +static void +record_buffer_markers (struct buffer *b) +{ + if (! NILP (BVAR (b, pt_marker))) + { + Lisp_Object buffer; + + eassert (!NILP (BVAR (b, begv_marker))); + eassert (!NILP (BVAR (b, zv_marker))); + + XSETBUFFER (buffer, b); + set_marker_both (BVAR (b, pt_marker), buffer, b->pt, b->pt_byte); + set_marker_both (BVAR (b, begv_marker), buffer, b->begv, b->begv_byte); + set_marker_both (BVAR (b, zv_marker), buffer, b->zv, b->zv_byte); + } +} + + +/* If buffer B has markers to record PT, BEGV and ZV when it is not + current, fetch these values into B->begv etc. */ + +static void +fetch_buffer_markers (struct buffer *b) +{ + if (! NILP (BVAR (b, pt_marker))) + { + Lisp_Object m; + + eassert (!NILP (BVAR (b, begv_marker))); + eassert (!NILP (BVAR (b, zv_marker))); + + m = BVAR (b, pt_marker); + SET_BUF_PT_BOTH (b, marker_position (m), marker_byte_position (m)); + + m = BVAR (b, begv_marker); + SET_BUF_BEGV_BOTH (b, marker_position (m), marker_byte_position (m)); + + m = BVAR (b, zv_marker); + SET_BUF_ZV_BOTH (b, marker_position (m), marker_byte_position (m)); + } +} + + DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, 2, 3, "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", @@ -527,12 +576,12 @@ /* Use the base buffer's text object. */ b->text = b->base_buffer->text; - BUF_BEGV (b) = BUF_BEGV (b->base_buffer); - BUF_ZV (b) = BUF_ZV (b->base_buffer); - BUF_PT (b) = BUF_PT (b->base_buffer); - BUF_BEGV_BYTE (b) = BUF_BEGV_BYTE (b->base_buffer); - BUF_ZV_BYTE (b) = BUF_ZV_BYTE (b->base_buffer); - BUF_PT_BYTE (b) = BUF_PT_BYTE (b->base_buffer); + b->pt = b->base_buffer->pt; + b->begv = b->base_buffer->begv; + b->zv = b->base_buffer->zv; + b->pt_byte = b->base_buffer->pt_byte; + b->begv_byte = b->base_buffer->begv_byte; + b->zv_byte = b->base_buffer->zv_byte; b->newline_cache = 0; b->width_run_cache = 0; @@ -562,24 +611,23 @@ /* Make sure the base buffer has markers for its narrowing. */ if (NILP (BVAR (b->base_buffer, pt_marker))) { + eassert (NILP (BVAR (b, begv_marker))); + eassert (NILP (BVAR (b, zv_marker))); + BVAR (b->base_buffer, pt_marker) = Fmake_marker (); set_marker_both (BVAR (b->base_buffer, pt_marker), base_buffer, - BUF_PT (b->base_buffer), - BUF_PT_BYTE (b->base_buffer)); - } - if (NILP (BVAR (b->base_buffer, begv_marker))) - { + b->base_buffer->pt, + b->base_buffer->pt_byte); + BVAR (b->base_buffer, begv_marker) = Fmake_marker (); set_marker_both (BVAR (b->base_buffer, begv_marker), base_buffer, - BUF_BEGV (b->base_buffer), - BUF_BEGV_BYTE (b->base_buffer)); - } - if (NILP (BVAR (b->base_buffer, zv_marker))) - { + b->base_buffer->begv, + b->base_buffer->begv_byte); + BVAR (b->base_buffer, zv_marker) = Fmake_marker (); set_marker_both (BVAR (b->base_buffer, zv_marker), base_buffer, - BUF_ZV (b->base_buffer), - BUF_ZV_BYTE (b->base_buffer)); + b->base_buffer->zv, + b->base_buffer->zv_byte); XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1; } @@ -587,11 +635,11 @@ { /* Give the indirect buffer markers for its narrowing. */ BVAR (b, pt_marker) = Fmake_marker (); - set_marker_both (BVAR (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b)); + set_marker_both (BVAR (b, pt_marker), buf, b->pt, b->pt_byte); BVAR (b, begv_marker) = Fmake_marker (); - set_marker_both (BVAR (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b)); + set_marker_both (BVAR (b, begv_marker), buf, b->begv, b->begv_byte); BVAR (b, zv_marker) = Fmake_marker (); - set_marker_both (BVAR (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b)); + set_marker_both (BVAR (b, zv_marker), buf, b->zv, b->zv_byte); XMARKER (BVAR (b, zv_marker))->insertion_type = 1; } else @@ -1796,27 +1844,7 @@ /* If the old current buffer has markers to record PT, BEGV and ZV when it is not current, update them now. */ - if (! NILP (BVAR (old_buf, pt_marker))) - { - Lisp_Object obuf; - XSETBUFFER (obuf, old_buf); - set_marker_both (BVAR (old_buf, pt_marker), obuf, - BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); - } - if (! NILP (BVAR (old_buf, begv_marker))) - { - Lisp_Object obuf; - XSETBUFFER (obuf, old_buf); - set_marker_both (BVAR (old_buf, begv_marker), obuf, - BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); - } - if (! NILP (BVAR (old_buf, zv_marker))) - { - Lisp_Object obuf; - XSETBUFFER (obuf, old_buf); - set_marker_both (BVAR (old_buf, zv_marker), obuf, - BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); - } + record_buffer_markers (old_buf); } /* Get the undo list from the base buffer, so that it appears @@ -1826,21 +1854,7 @@ /* If the new current buffer has markers to record PT, BEGV and ZV when it is not current, fetch them now. */ - if (! NILP (BVAR (b, pt_marker))) - { - BUF_PT (b) = marker_position (BVAR (b, pt_marker)); - BUF_PT_BYTE (b) = marker_byte_position (BVAR (b, pt_marker)); - } - if (! NILP (BVAR (b, begv_marker))) - { - BUF_BEGV (b) = marker_position (BVAR (b, begv_marker)); - BUF_BEGV_BYTE (b) = marker_byte_position (BVAR (b, begv_marker)); - } - if (! NILP (BVAR (b, zv_marker))) - { - BUF_ZV (b) = marker_position (BVAR (b, zv_marker)); - BUF_ZV_BYTE (b) = marker_byte_position (BVAR (b, zv_marker)); - } + fetch_buffer_markers (b); /* Look down buffer's list of local Lisp variables to find and update any that forward into C variables. */ @@ -1876,50 +1890,13 @@ old_buf = current_buffer; current_buffer = b; - if (old_buf) - { - /* If the old current buffer has markers to record PT, BEGV and ZV - when it is not current, update them now. */ - if (! NILP (BVAR (old_buf, pt_marker))) - { - Lisp_Object obuf; - XSETBUFFER (obuf, old_buf); - set_marker_both (BVAR (old_buf, pt_marker), obuf, - BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); - } - if (! NILP (BVAR (old_buf, begv_marker))) - { - Lisp_Object obuf; - XSETBUFFER (obuf, old_buf); - set_marker_both (BVAR (old_buf, begv_marker), obuf, - BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); - } - if (! NILP (BVAR (old_buf, zv_marker))) - { - Lisp_Object obuf; - XSETBUFFER (obuf, old_buf); - set_marker_both (BVAR (old_buf, zv_marker), obuf, - BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); - } - } + /* If the old current buffer has markers to record PT, BEGV and ZV + when it is not current, update them now. */ + record_buffer_markers (old_buf); /* If the new current buffer has markers to record PT, BEGV and ZV when it is not current, fetch them now. */ - if (! NILP (BVAR (b, pt_marker))) - { - BUF_PT (b) = marker_position (BVAR (b, pt_marker)); - BUF_PT_BYTE (b) = marker_byte_position (BVAR (b, pt_marker)); - } - if (! NILP (BVAR (b, begv_marker))) - { - BUF_BEGV (b) = marker_position (BVAR (b, begv_marker)); - BUF_BEGV_BYTE (b) = marker_byte_position (BVAR (b, begv_marker)); - } - if (! NILP (BVAR (b, zv_marker))) - { - BUF_ZV (b) = marker_position (BVAR (b, zv_marker)); - BUF_ZV_BYTE (b) = marker_byte_position (BVAR (b, zv_marker)); - } + fetch_buffer_markers (b); } DEFUN ("set-buffer", Fset_buffer, Sset_buffer, 1, 1, 0, === modified file 'src/buffer.h' --- src/buffer.h 2011-02-16 18:39:46 +0000 +++ src/buffer.h 2011-03-13 22:25:16 +0000 @@ -107,27 +107,46 @@ #define BUF_BEG(buf) (BEG) #define BUF_BEG_BYTE(buf) (BEG_BYTE) -/* !!!FIXME: all the BUF_BEGV/BUF_ZV/BUF_PT macros are flawed: - on indirect (or base) buffers, that value is only correct if that buffer - is the current_buffer, or if the buffer's text hasn't been modified (via - an indirect buffer) since it was last current. */ +/* The BUF_BEGV[_BYTE], BUF_ZV[_BYTE], and BUF_PT[_BYTE] macros cannot + be used for assignment; use SET_BUF_* macros below for that. */ /* Position of beginning of accessible range of buffer. */ -#define BUF_BEGV(buf) ((buf)->begv) -#define BUF_BEGV_BYTE(buf) ((buf)->begv_byte) +#define BUF_BEGV(buf) \ + (buf == current_buffer ? BEGV \ + : NILP (BVAR (buf, begv_marker)) ? buf->begv \ + : marker_position (BVAR (buf, begv_marker))) + +#define BUF_BEGV_BYTE(buf) \ + (buf == current_buffer ? BEGV_BYTE \ + : NILP (BVAR (buf, begv_marker)) ? buf->begv_byte \ + : marker_byte_position (BVAR (buf, begv_marker))) /* Position of point in buffer. */ -#define BUF_PT(buf) ((buf)->pt) -#define BUF_PT_BYTE(buf) ((buf)->pt_byte) +#define BUF_PT(buf) \ + (buf == current_buffer ? PT \ + : NILP (BVAR (buf, pt_marker)) ? buf->pt \ + : marker_position (BVAR (buf, pt_marker))) + +#define BUF_PT_BYTE(buf) \ + (buf == current_buffer ? PT_BYTE \ + : NILP (BVAR (buf, pt_marker)) ? buf->pt_byte \ + : marker_byte_position (BVAR (buf, pt_marker))) + +/* Position of end of accessible range of buffer. */ +#define BUF_ZV(buf) \ + (buf == current_buffer ? ZV \ + : NILP (BVAR (buf, zv_marker)) ? buf->zv \ + : marker_position (BVAR (buf, zv_marker))) + +#define BUF_ZV_BYTE(buf) \ + (buf == current_buffer ? ZV_BYTE \ + : NILP (BVAR (buf, zv_marker)) ? buf->zv_byte \ + : marker_byte_position (BVAR (buf, zv_marker))) /* Position of gap in buffer. */ #define BUF_GPT(buf) ((buf)->text->gpt) #define BUF_GPT_BYTE(buf) ((buf)->text->gpt_byte) -/* Position of end of accessible range of buffer. */ -#define BUF_ZV(buf) ((buf)->zv) -#define BUF_ZV_BYTE(buf) ((buf)->zv_byte) - /* Position of end of buffer. */ #define BUF_Z(buf) ((buf)->text->z) #define BUF_Z_BYTE(buf) ((buf)->text->z_byte) @@ -235,8 +254,6 @@ /* Macros for setting the BEGV, ZV or PT of a given buffer. - SET_BUF_PT* seet to be redundant. Get rid of them? - The ..._BOTH macros take both a charpos and a bytepos, which must correspond to each other. === modified file 'src/insdel.c' --- src/insdel.c 2011-02-16 15:02:50 +0000 +++ src/insdel.c 2011-03-13 22:25:16 +0000 @@ -411,9 +411,7 @@ static void adjust_point (EMACS_INT nchars, EMACS_INT nbytes) { - BUF_PT (current_buffer) += nchars; - BUF_PT_BYTE (current_buffer) += nbytes; - + SET_BUF_PT_BOTH (current_buffer, PT + nchars, PT_BYTE + nbytes); /* In a single-byte buffer, the two positions must be equal. */ eassert (PT_BYTE >= PT && PT_BYTE - PT <= ZV_BYTE - ZV); } === modified file 'src/intervals.c' --- src/intervals.c 2011-02-16 15:02:50 +0000 +++ src/intervals.c 2011-03-13 22:25:16 +0000 @@ -1892,8 +1892,7 @@ if (charpos > BUF_ZV (buffer) || charpos < BUF_BEGV (buffer)) abort (); - BUF_PT_BYTE (buffer) = bytepos; - BUF_PT (buffer) = charpos; + SET_BUF_PT_BOTH (buffer, charpos, bytepos); } /* Set point "temporarily", without checking any text properties. */ @@ -2312,10 +2311,9 @@ old_zv = BUF_ZV (buffer); old_begv_byte = BUF_BEGV_BYTE (buffer); old_zv_byte = BUF_ZV_BYTE (buffer); - BUF_BEGV (buffer) = BUF_BEG (buffer); - BUF_ZV (buffer) = BUF_Z (buffer); - BUF_BEGV_BYTE (buffer) = BUF_BEG_BYTE (buffer); - BUF_ZV_BYTE (buffer) = BUF_Z_BYTE (buffer); + + SET_BUF_BEGV_BOTH (buffer, BUF_BEG (buffer), BUF_BEG_BYTE (buffer)); + SET_BUF_ZV_BOTH (buffer, BUF_Z (buffer), BUF_Z_BYTE (buffer)); XSETFASTINT (lispy_position, position); XSETBUFFER (lispy_buffer, buffer); @@ -2329,10 +2327,8 @@ if (NILP (prop)) prop = get_pos_property (lispy_position, type, lispy_buffer); - BUF_BEGV (buffer) = old_begv; - BUF_ZV (buffer) = old_zv; - BUF_BEGV_BYTE (buffer) = old_begv_byte; - BUF_ZV_BYTE (buffer) = old_zv_byte; + SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte); + SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte); /* Use the local map only if it is valid. */ prop = get_keymap (prop, 0, 0); === modified file 'src/lread.c' --- src/lread.c 2011-02-22 18:02:11 +0000 +++ src/lread.c 2011-03-13 22:25:16 +0000 @@ -368,15 +368,15 @@ else if (BUFFERP (readcharfun)) { struct buffer *b = XBUFFER (readcharfun); + EMACS_INT charpos = BUF_PT (b); EMACS_INT bytepos = BUF_PT_BYTE (b); - BUF_PT (b)--; if (! NILP (BVAR (b, enable_multibyte_characters))) BUF_DEC_POS (b, bytepos); else bytepos--; - BUF_PT_BYTE (b) = bytepos; + SET_BUF_PT_BOTH (b, charpos - 1, bytepos); } else if (MARKERP (readcharfun)) { === modified file 'src/xdisp.c' --- src/xdisp.c 2011-03-07 06:39:56 +0000 +++ src/xdisp.c 2011-03-13 22:25:16 +0000 @@ -10909,7 +10909,7 @@ current_buffer = XBUFFER (w->buffer); if (w == XWINDOW (selected_window)) - pt = BUF_PT (current_buffer); + pt = PT; else { pt = marker_position (w->pointm); @@ -11347,7 +11347,7 @@ EMACS_INT pt; if (w == XWINDOW (selected_window)) - pt = BUF_PT (current_buffer); + pt = PT; else pt = marker_position (w->pointm);