# HG changeset patch # User Karoly Lorentey # Date 1085678657 0 # Node ID 85232760f917974c58c1999bb75ff8fb6ee55b7c # Parent d663e2b036e0c77836f4a6f683b2a95f6453d376# Parent de35aa92d3f3d7824b3f8cee176b169988470228 Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-342 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-343 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-178 diff -r d663e2b036e0 -r 85232760f917 lisp/ChangeLog --- a/lisp/ChangeLog Thu May 27 17:23:38 2004 +0000 +++ b/lisp/ChangeLog Thu May 27 17:24:17 2004 +0000 @@ -1,7 +1,46 @@ +2004-05-25 Juri Linkov + + * info.el (Info-toc): Call Info-mode on intermediate buffer. + (Info-index-nodes): Enclose code in condition-case to catch errors. + (Info-index-node): Don't search all index nodes if request is only + for the current node and file is not in the cache of index nodes. + (Info-mode-map): Bind Info-copy-current-node-name to `w' + for consistency with dired-copy-filename-as-kill. + Bind `S' to Info-search-case-sensitively. + (Info-copy-current-node-name): New arg. With zero prefix arg put + the name inside a function call to `info'. Display copied text in + the echo area. + +2004-05-25 Sam Steingold + + * emacs-lisp/lisp-mode.el (lisp-find-tag-default): New function: + strip the package prefix from the symbol name, if any. + Make it the `find-tag-default-function' for `lisp-mode'. + +2004-05-25 John Paul Wallington + + * gs.el (gs-load-image): Use `set-process-query-on-exit-flag' + instead of obsolete `process-kill-without-query'. + + * textmodes/texinfmt.el (texinfo-indexvar-alist): + Declare as variable, not constant. + +2004-05-25 Luc Teirlinck + + * files.el (find-file-noselect-1): Fix bug introduced by + Revision 1.694. As a side effect, `inhibit-read-only' + is again, by default, t during execution of + `find-file-not-found-functions'. + (insert-directory): Check that lines were really inserted by + the --dired switch, before erasing them. + 2004-05-24 Nick Roberts - * progmodes/gdb-ui.el (gdb-breakpoints-mode, gdb-frames-mode) + * progmodes/gdb-ui.el (gdb-breakpoints-mode, gdb-frames-mode) (gdb-locals-mode): Check gud-minor-mode in gud-comint-buffer. + (gdb-var-update, gdb-var-update-handler, gdb-var-delete) + (gdb-edit-value, gdb-speedbar-expand-node): Handle new value for + gud-minor-mode (gdbmi). 2004-05-24 Yoichi NAKAYAMA (tiny change) @@ -2495,7 +2534,7 @@ 2004-03-28 Stefan Monnier * vc-hooks.el (vc-file-not-found-hook): Fix typo. - From lorentey@elte.hu (L,Bu(Brentey K,Ba(Broly). + From lorentey@elte.hu (L$,1 q(Brentey K,Aa(Broly). 2004-03-27 Luc Teirlinck diff -r d663e2b036e0 -r 85232760f917 lisp/emacs-lisp/lisp-mode.el --- a/lisp/emacs-lisp/lisp-mode.el Thu May 27 17:23:38 2004 +0000 +++ b/lisp/emacs-lisp/lisp-mode.el Thu May 27 17:24:17 2004 +0000 @@ -355,6 +355,14 @@ (setq imenu-case-fold-search t) (set-syntax-table lisp-mode-syntax-table) (run-mode-hooks 'lisp-mode-hook)) +(put 'lisp-mode 'find-tag-default-function 'lisp-find-tag-default) + +(defun lisp-find-tag-default () + (let ((default (find-tag-default))) + (when (stringp default) + (if (string-match ":+" default) + (substring default (match-end 0)) + default)))) ;; Used in old LispM code. (defalias 'common-lisp-mode 'lisp-mode) diff -r d663e2b036e0 -r 85232760f917 lisp/files.el --- a/lisp/files.el Thu May 27 17:23:38 2004 +0000 +++ b/lisp/files.el Thu May 27 17:24:17 2004 +0000 @@ -1379,20 +1379,19 @@ (signal 'file-error (list "File is not readable" filename))) ;; Unconditionally set error - (setq error t))))) - (condition-case () - (let ((inhibit-read-only t)) - (insert-file-contents filename t)) - (file-error - (when (and (file-exists-p filename) - (not (file-readable-p filename))) - (kill-buffer buf) - (signal 'file-error (list "File is not readable" - filename))) - ;; Run find-file-not-found-hooks until one returns non-nil. - (or (run-hook-with-args-until-success 'find-file-not-found-functions) - ;; If they fail too, set error. - (setq error t)))) + (setq error t))) + (condition-case () + (insert-file-contents filename t) + (file-error + (when (and (file-exists-p filename) + (not (file-readable-p filename))) + (kill-buffer buf) + (signal 'file-error (list "File is not readable" + filename))) + ;; Run find-file-not-found-hooks until one returns non-nil. + (or (run-hook-with-args-until-success 'find-file-not-found-functions) + ;; If they fail too, set error. + (setq error t)))))) ;; Record the file's truename, and maybe use that as visited name. (if (equal filename buffer-file-name) (setq buffer-file-truename truename) @@ -4336,21 +4335,26 @@ (when (looking-at "//SUBDIRED//") (delete-region (point) (progn (forward-line 1) (point))) (forward-line -1)) - (let ((end (line-end-position))) - (forward-word 1) - (forward-char 3) - (while (< (point) end) - (let ((start (+ beg (read (current-buffer)))) - (end (+ beg (read (current-buffer))))) - (if (= (char-after end) ?\n) - (put-text-property start end 'dired-filename t) - ;; It seems that we can't trust ls's output as to - ;; byte positions of filenames. - (put-text-property beg (point) 'dired-filename nil) - (end-of-line)))) - (goto-char end) - (beginning-of-line) - (delete-region (point) (progn (forward-line 2) (point))))) + (if (looking-at "//DIRED//") + (let ((end (line-end-position))) + (forward-word 1) + (forward-char 3) + (while (< (point) end) + (let ((start (+ beg (read (current-buffer)))) + (end (+ beg (read (current-buffer))))) + (if (= (char-after end) ?\n) + (put-text-property start end 'dired-filename t) + ;; It seems that we can't trust ls's output as to + ;; byte positions of filenames. + (put-text-property beg (point) 'dired-filename nil) + (end-of-line)))) + (goto-char end) + (beginning-of-line) + (delete-region (point) (progn (forward-line 2) (point)))) + (forward-line 1) + (if (looking-at "//DIRED-OPTIONS//") + (delete-region (point) (progn (forward-line 1) (point))) + (forward-line 1)))) ;; Now decode what read if necessary. (let ((coding (or coding-system-for-read diff -r d663e2b036e0 -r 85232760f917 lisp/gs.el --- a/lisp/gs.el Thu May 27 17:23:38 2004 +0000 +++ b/lisp/gs.el Thu May 27 17:24:17 2004 +0000 @@ -1,6 +1,6 @@ ;;; gs.el --- interface to Ghostscript -;; Copyright (C) 1998, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001, 2004 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal @@ -197,7 +197,7 @@ (setenv "GHOSTVIEW" window-and-pixmap-id) (setq gs (apply 'start-process "gs" "*GS*" gs-program (gs-options gs-device file))) - (process-kill-without-query gs) + (set-process-query-on-exit-flag gs nil) gs) nil)) diff -r d663e2b036e0 -r 85232760f917 lisp/info.el --- a/lisp/info.el Thu May 27 17:23:38 2004 +0000 +++ b/lisp/info.el Thu May 27 17:24:17 2004 +0000 @@ -1691,6 +1691,7 @@ (if (not (bobp)) (let ((Info-hide-note-references 'hide) (Info-fontify-visited-nodes nil)) + (Info-mode) (setq Info-current-file "toc" Info-current-node "Top") (Info-fontify-node))) (goto-char (point-min)) @@ -2349,78 +2350,97 @@ (defun Info-index-nodes (&optional file) "Return a list of names of all index nodes in Info FILE. If FILE is omitted, it defaults to the current Info file. -First look in a list of cached index node names. Then scan Info file -and its subfiles for nodes with index cookie. Then try index nodes -starting from the first node in the top level menu whose name -contains the word \"Index\", plus any immediately following nodes -whose names also contain the word \"Index\"." +First look in a list of cached index node names. Then scan Info +file and its subfiles for nodes with the index cookie. Then try +to find index nodes starting from the first node in the top level +menu whose name contains the word \"Index\", plus any immediately +following nodes whose names also contain the word \"Index\"." (or file (setq file Info-current-file)) (or (assoc file Info-index-nodes) ;; Skip virtual Info files - (member file '("dir" "history" "toc" "apropos")) + (and (member file '("dir" "history" "toc" "apropos")) + (setq Info-index-nodes (cons (cons file nil) Info-index-nodes))) + (not (stringp file)) ;; Find nodes with index cookie (let* ((default-directory (or (and (stringp file) (file-name-directory (setq file (Info-find-file file)))) default-directory)) - (main-file file) - (Info-fontify-maximum-menu-size nil) - subfiles nodes node Info-history Info-history-list) - (with-temp-buffer - (while (or main-file subfiles) - (erase-buffer) - (info-insert-file-contents (or main-file (car subfiles))) - (goto-char (point-min)) - (while (search-forward "\0\10[index\0\10]" nil 'move) - (save-excursion - (re-search-backward "^\^_") - (search-forward "Node: ") - (setq nodes (cons (Info-following-node-name) nodes)))) - (if main-file - (save-excursion - (goto-char (point-min)) - (if (search-forward "\n\^_\nIndirect:" nil t) - (let ((bound (save-excursion (search-forward "\n\^_" nil t)))) - (while (re-search-forward "^\\(.*\\): [0-9]+$" bound t) - (setq subfiles (cons (match-string-no-properties 1) - subfiles))))) - (setq subfiles (nreverse subfiles) - main-file nil)) - (setq subfiles (cdr subfiles))))) + Info-history Info-history-list Info-fontify-maximum-menu-size + (main-file file) subfiles nodes node) + (condition-case nil + (with-temp-buffer + (while (or main-file subfiles) + (erase-buffer) + (info-insert-file-contents (or main-file (car subfiles))) + (goto-char (point-min)) + (while (search-forward "\0\b[index\0\b]" nil 'move) + (save-excursion + (re-search-backward "^\^_") + (search-forward "Node: ") + (setq nodes (cons (Info-following-node-name) nodes)))) + (if main-file + (save-excursion + (goto-char (point-min)) + (if (search-forward "\n\^_\nIndirect:" nil t) + (let ((bound (save-excursion (search-forward "\n\^_" nil t)))) + (while (re-search-forward "^\\(.*\\): [0-9]+$" bound t) + (setq subfiles (cons (match-string-no-properties 1) + subfiles))))) + (setq subfiles (nreverse subfiles) + main-file nil)) + (setq subfiles (cdr subfiles))))) + (error nil)) (if nodes (setq nodes (nreverse nodes) Info-index-nodes (cons (cons file nodes) Info-index-nodes))) nodes) - ;; Find nodes with string "Index" in node names - (let ((Info-fontify-maximum-menu-size nil) - (case-fold-search t) - nodes node Info-history Info-history-list) - (with-temp-buffer - (Info-mode) - (Info-find-node file "Top") - (when (and (search-forward "\n* menu:" nil t) - (re-search-forward "\n\\* \\(.*\\\\)" nil t)) - (goto-char (match-beginning 1)) - (setq nodes (list (Info-extract-menu-node-name))) - (Info-goto-node (car nodes)) - (while (and (setq node (Info-extract-pointer "next" t)) - (string-match "\\" node)) - (setq nodes (cons node nodes)) - (Info-goto-node node)))) + ;; Find nodes with the word "Index" in the node name + (let ((case-fold-search t) + Info-history Info-history-list Info-fontify-maximum-menu-size + nodes node) + (condition-case nil + (with-temp-buffer + (Info-mode) + (Info-find-node file "Top") + (when (and (search-forward "\n* menu:" nil t) + (re-search-forward "\n\\* \\(.*\\\\)" nil t)) + (goto-char (match-beginning 1)) + (setq nodes (list (Info-extract-menu-node-name))) + (Info-goto-node (car nodes)) + (while (and (setq node (Info-extract-pointer "next" t)) + (string-match "\\" node)) + (setq nodes (cons node nodes)) + (Info-goto-node node)))) + (error nil)) (if nodes (setq nodes (nreverse nodes) Info-index-nodes (cons (cons file nodes) Info-index-nodes))) nodes) - ;; Info file has no index nodes - (setq Info-index-nodes (cons (cons file nil) - Info-index-nodes))) + ;; If file has no index nodes, still add it to the cache + (setq Info-index-nodes (cons (cons file nil) Info-index-nodes))) (cdr (assoc file Info-index-nodes))) (defun Info-index-node (&optional node file) "Return non-nil value if NODE is an index node. If NODE is nil, check the current Info node. If FILE is nil, check the current Info file." - (member (or node Info-current-node) (Info-index-nodes file))) + (if (or (and node (not (equal node Info-current-node))) + (assoc (or file Info-current-file) Info-index-nodes)) + (member (or node Info-current-node) (Info-index-nodes file)) + ;; Don't search all index nodes if request is only for the current node + ;; and file is not in the cache of index nodes + (or + (save-match-data + (string-match "\\" (or node Info-current-node ""))) + (save-excursion + (goto-char (+ (or (save-excursion + (search-backward "\n\^_" nil t)) + (point-min)) 2)) + (search-forward "\0\b[index\0\b]" + (or (save-excursion + (search-forward "\n\^_" nil t)) + (point-max)) t))))) (defun Info-goto-index () "Go to the first index node." @@ -2771,11 +2791,14 @@ (define-key Info-mode-map "p" 'Info-prev) (define-key Info-mode-map "q" 'Info-exit) (define-key Info-mode-map "s" 'Info-search) + (define-key Info-mode-map "S" 'Info-search-case-sensitively) ;; For consistency with Rmail. (define-key Info-mode-map "\M-s" 'Info-search) (define-key Info-mode-map "\M-n" 'clone-buffer) (define-key Info-mode-map "t" 'Info-top-node) (define-key Info-mode-map "u" 'Info-up) + ;; For consistency with dired-copy-filename-as-kill. + (define-key Info-mode-map "w" 'Info-copy-current-node-name) (define-key Info-mode-map "," 'Info-index-next) (define-key Info-mode-map "\177" 'Info-scroll-down) (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node) @@ -2920,20 +2943,23 @@ (error (ding)))) -(defun Info-copy-current-node-name () +(defun Info-copy-current-node-name (&optional arg) "Put the name of the current info node into the kill ring. -The name of the info file is prepended to the node name in parentheses." - (interactive) +The name of the info file is prepended to the node name in parentheses. +With a zero prefix arg, put the name inside a function call to `info'." + (interactive "P") (unless Info-current-node (error "No current info node")) - (kill-new - (concat "(" - (file-name-nondirectory - (if (stringp Info-current-file) - Info-current-file - (or buffer-file-name ""))) - ")" - Info-current-node))) + (let ((node (concat "(" (file-name-nondirectory + (or (and (stringp Info-current-file) + Info-current-file) + buffer-file-name + "")) + ")" Info-current-node))) + (if (zerop (prefix-numeric-value arg)) + (setq node (concat "(info \"" node "\")"))) + (kill-new node) + (message "%s" node))) ;; Info mode is suitable only for specially formatted data. diff -r d663e2b036e0 -r 85232760f917 lisp/progmodes/gdb-ui.el --- a/lisp/progmodes/gdb-ui.el Thu May 27 17:23:38 2004 +0000 +++ b/lisp/progmodes/gdb-ui.el Thu May 27 17:24:17 2004 +0000 @@ -319,7 +319,11 @@ (defun gdb-var-update () (if (not (member 'gdb-var-update gdb-pending-triggers)) (progn - (gdb-enqueue-input (list "server interpreter mi \"-var-update *\"\n" + (gdb-enqueue-input + (list + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + "server interpreter mi \"-var-update *\"\n" + "-var-update *\n") 'gdb-var-update-handler)) (push 'gdb-var-update gdb-pending-triggers)))) @@ -331,8 +335,11 @@ (while (re-search-forward gdb-var-update-regexp nil t) (let ((varnum (match-string 1))) (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-evaluate-expression " - varnum "\"\n") + (list + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + (concat "server interpreter mi \"-var-evaluate-expression " + varnum "\"\n") + (concat "-var-evaluate-expression " varnum "\n")) `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))) (setq gdb-pending-triggers @@ -349,8 +356,11 @@ (varnum (cadr var))) (unless (string-match "\\." varnum) (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-delete " - varnum "\"\n") + (list + (if (with-current-buffer gud-comint-buffer + (eq gud-minor-mode 'gdba)) + (concat "server interpreter mi \"-var-delete " varnum "\"\n") + (concat "-var-delete " varnum "\n")) 'ignore)) (setq gdb-var-list (delq var gdb-var-list)) (dolist (varchild gdb-var-list) @@ -364,8 +374,11 @@ (varnum (cadr var)) (value)) (setq value (read-string "New value: ")) (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-assign " - varnum " " value "\"\n") + (list + (if (with-current-buffer gud-comint-buffer + (eq gud-minor-mode 'gdba)) + (concat "server interpreter mi \"-var-assign " varnum " " value "\"\n") + (concat "-var-assign " varnum " " value "\n")) 'ignore)))) (defcustom gdb-show-changed-values t @@ -380,7 +393,9 @@ TOKEN is data related to this node. INDENT is the current indentation depth." (cond ((string-match "+" text) ;expand this node - (gdb-var-list-children token)) + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + (gdb-var-list-children token) + (gdbmi-var-list-children token))) ((string-match "-" text) ;contract this node (dolist (var gdb-var-list) (if (string-match (concat token "\\.") (nth 1 var)) diff -r d663e2b036e0 -r 85232760f917 lisp/textmodes/texinfmt.el --- a/lisp/textmodes/texinfmt.el Thu May 27 17:23:38 2004 +0000 +++ b/lisp/textmodes/texinfmt.el Thu May 27 17:24:17 2004 +0000 @@ -2899,7 +2899,7 @@ 1)) (symbol-value indexvar))))) -(defconst texinfo-indexvar-alist +(defvar texinfo-indexvar-alist '(("cp" . texinfo-cindex) ("fn" . texinfo-findex) ("vr" . texinfo-vindex) diff -r d663e2b036e0 -r 85232760f917 src/ChangeLog --- a/src/ChangeLog Thu May 27 17:23:38 2004 +0000 +++ b/src/ChangeLog Thu May 27 17:24:17 2004 +0000 @@ -1,3 +1,18 @@ +2004-05-27 Kim F. Storm + + * xdisp.c (back_to_previous_visible_line_start): Skip backwards + over display properties, e.g. images, that replace buffer text. + +2004-05-25 Kim F. Storm + + * alloc.c (marker_blocks_pending_free): New var. + (gc_sweep): Store free marker blocks on that list. + (Fgarbage_collect): Free them after undo-list cleanup. + + * process.c (wait_reading_process_input): Check connect_wait_mask + before actually accepting connection in case it has already been + accepted due to recursion. + 2004-05-23 K,Ba(Broly L,Bu(Brentey (tiny change) * coding.c (Fset_safe_terminal_coding_system_internal): Set diff -r d663e2b036e0 -r 85232760f917 src/alloc.c --- a/src/alloc.c Thu May 27 17:23:38 2004 +0000 +++ b/src/alloc.c Thu May 27 17:24:17 2004 +0000 @@ -2866,6 +2866,10 @@ union Lisp_Misc *marker_free_list; +/* Marker blocks which should be freed at end of GC. */ + +struct marker_block *marker_blocks_pending_free; + /* Total number of marker blocks now in use. */ int n_marker_blocks; @@ -2876,6 +2880,7 @@ marker_block = NULL; marker_block_index = MARKER_BLOCK_SIZE; marker_free_list = 0; + marker_blocks_pending_free = 0; n_marker_blocks = 0; } @@ -4531,6 +4536,18 @@ } } + /* Undo lists have been cleaned up, so we can free marker blocks now. */ + + { + struct marker_block *mblk; + + while ((mblk = marker_blocks_pending_free) != 0) + { + marker_blocks_pending_free = mblk->next; + lisp_free (mblk); + } + } + /* Clear the mark bits that we set in certain root slots. */ unmark_byte_stack (); @@ -5439,6 +5456,7 @@ register int num_free = 0, num_used = 0; marker_free_list = 0; + marker_blocks_pending_free = 0; for (mblk = marker_block; mblk; mblk = *mprev) { @@ -5469,19 +5487,20 @@ /* If this block contains only free markers and we have already seen more than two blocks worth of free markers then deallocate this block. */ -#if 0 - /* There may still be pointers to these markers from a buffer's - undo list, so don't free them. KFS 2004-05-21 / if (this_free == MARKER_BLOCK_SIZE && num_free > MARKER_BLOCK_SIZE) { *mprev = mblk->next; /* Unhook from the free list. */ marker_free_list = mblk->markers[0].u_free.chain; - lisp_free (mblk); n_marker_blocks--; + + /* It is not safe to free the marker block at this stage, + since there may still be pointers to these markers from + a buffer's undo list. KFS 2004-05-25. */ + mblk->next = marker_blocks_pending_free; + marker_blocks_pending_free = mblk; } else -#endif { num_free += this_free; mprev = &mblk->next; diff -r d663e2b036e0 -r 85232760f917 src/process.c --- a/src/process.c Thu May 27 17:23:38 2004 +0000 +++ b/src/process.c Thu May 27 17:24:17 2004 +0000 @@ -4581,7 +4581,8 @@ } } #ifdef NON_BLOCKING_CONNECT - if (check_connect && FD_ISSET (channel, &Connecting)) + if (check_connect && FD_ISSET (channel, &Connecting) + && FD_ISSET (channel, &connect_wait_mask)) { struct Lisp_Process *p; diff -r d663e2b036e0 -r 85232760f917 src/xdisp.c --- a/src/xdisp.c Thu May 27 17:23:38 2004 +0000 +++ b/src/xdisp.c Thu May 27 17:24:17 2004 +0000 @@ -4559,6 +4559,14 @@ visible_p = 0; } + if (visible_p) + { + struct it it2 = *it; + + if (handle_display_prop (&it2) == HANDLED_RETURN) + visible_p = 0; + } + /* Back one more newline if the current one is invisible. */ if (!visible_p) back_to_previous_line_start (it);