* Searching IDs in same window
@ 2013-06-26 18:33 Rami A
0 siblings, 0 replies; only message in thread
From: Rami A @ 2013-06-26 18:33 UTC (permalink / raw)
To: help-gnu-emacs
Greetings,
I have the following code in my dotemacs file which searches the IDs and show the results in a separate window "when I have two split windows open".
How do I modify it so I could view the results in the "same window"?
;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ID searching - Start ::
;;;;;;;;;;;;;;;;;;;;;;;;;;
; gid.el -- run gid using compilation mode.
;(require 'compile)
;(require 'elisp-utils)
;(provide 'gid)
(defvar gid-command "gid" "The command run by the gid function.")
(defun gid (args)
"Run gid, with user-specified ARGS, and collect output in a buffer.
While gid runs asynchronously, you can use the \\[next-error] command to
find the text that gid hits refer to. The command actually run is
defined by the gid-command variable."
(interactive (list
;(read-input (concat "Run " gid-command " (with args): ") ;confirmation
(word-around-point)))
;)
;; Preserve the present compile-command
(let (compile-command
(gid-buffer ;; if gid for each symbol use: compilation-buffer-name-function
(lambda (mode) (concat "*gid " args "*"))))
;; For portability between v18 & v19, use compile rather than compile-internal
(compile (concat gid-command " " args))))
(defun word-around-point ()
"Return the word around the point as a string."
(save-excursion
(if (not (eobp))
(forward-char 1))
(forward-word -1)
(forward-word 1)
(forward-sexp -1)
(let ((beg (point)))
(forward-sexp 1)
(buffer-substring beg (point)))))
(global-set-key [f4] 'gid) ; defined
;;;;;;;;;;;;;;;;;;;;;;;;
;; ID searching - End ::
;;;;;;;;;;;;;;;;;;;;;;;;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-06-26 18:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-26 18:33 Searching IDs in same window Rami A
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).