unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] find-file-noselect-1
@ 2005-02-10 20:36 Nick Roberts
  2005-02-11  0:19 ` Miles Bader
  2005-02-11  3:19 ` Stefan Monnier
  0 siblings, 2 replies; 22+ messages in thread
From: Nick Roberts @ 2005-02-10 20:36 UTC (permalink / raw)



I would like to change find-file-noselect-1, which is called by find-file.  It
would mean that if you visit a file that is part of the source code of the
current GDB session, then you can set a breakpoint by clicking in the
fringe. Pretty good huh! It could also mean that I've broken find-file, just
before the release. Not so good. Thats why I am posting it here first.

Nick


*** /home/nick/emacs/lisp/files.el.~1.745.~	2005-02-10 08:22:48.000000000 +1300
--- /home/nick/emacs/lisp/files.el	2005-02-11 09:06:39.000000000 +1300
***************
*** 1511,1516 ****
--- 1511,1525 ----
  	    (make-local-variable 'find-file-literally)
  	    (setq find-file-literally t))
  	(after-find-file error (not nowarn)))
+       (if (and (boundp 'gud-comint-buffer)
+ 	       (buffer-name gud-comint-buffer)
+ 	       (with-current-buffer gud-comint-buffer
+ 		 (eq gud-minor-mode 'gdba)))
+ 	  (progn
+ 	    (gdb-enqueue-input
+ 	     (list (concat "list " (file-name-nondirectory buffer-file-name)
+ 			   ":1\n")
+ 		   `(lambda () (gdb-set-gud-minor-mode ,buffer-file-name))))))
        (current-buffer))))
  \f
  (defun insert-file-contents-literally (filename &optional visit beg end replace)


*** /home/nick/emacs/lisp/progmodes/gdb-ui.el.~1.47.~	2005-02-10 08:22:54.000000000 +1300
--- /home/nick/emacs/lisp/progmodes/gdb-ui.el	2005-02-11 09:07:10.000000000 +1300
***************
*** 2085,2090 ****
--- 2085,2100 ----
        (goto-line (string-to-number line))
        (gdb-put-breakpoint-icon (eq flag ?y) bptno))))
  
+ (defun gdb-set-gud-minor-mode (file)
+   "Set gud-minor-mode from find-file if appropriate."
+   (goto-char (point-min))
+   (unless (search-forward "No source file named " nil t)
+       (with-current-buffer
+ 	  (find-file-noselect file)
+ 	(save-current-buffer
+ 	  (set (make-local-variable 'gud-minor-mode) 'gdba)
+ 	  (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)))))
+ 
  ;;from put-image
  (defun gdb-put-string (putstring pos &optional dprop)
    "Put string PUTSTRING in front of POS in the current buffer.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2005-02-15  6:15 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-10 20:36 [PATCH] find-file-noselect-1 Nick Roberts
2005-02-11  0:19 ` Miles Bader
2005-02-11  2:49   ` Nick Roberts
2005-02-11  3:03     ` Nick Roberts
2005-02-12  8:38       ` Richard Stallman
2005-02-12 10:30         ` Nick Roberts
2005-02-12 16:50           ` Stefan Monnier
2005-02-13  5:31             ` Nick Roberts
2005-02-13 16:14               ` Stefan Monnier
2005-02-13 12:38           ` Richard Stallman
2005-02-13 20:49             ` Nick Roberts
2005-02-15  6:15               ` Richard Stallman
2005-02-11  3:16     ` Stefan Monnier
2005-02-11  3:19 ` Stefan Monnier
2005-02-11  8:08   ` Nick Roberts
2005-02-11  8:51     ` Kim F. Storm
2005-02-11  9:53       ` Nick Roberts
2005-02-11 10:30         ` Kim F. Storm
2005-02-11 10:05       ` Miles Bader
2005-02-11 10:29         ` Kim F. Storm
2005-02-11 10:44           ` Nick Roberts
2005-02-11 13:05             ` Kim F. Storm

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).