all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* New function: what-file-line, used when writing gdb script
  2008-11-03 12:45   ` Kenichi Handa
@ 2008-11-22 17:03     ` richardeng
  0 siblings, 0 replies; 2+ messages in thread
From: richardeng @ 2008-11-22 17:03 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1353 bytes --]

Hi all,

When I write gdb script, I need to set many breakpoints. such as:
b xxx_file.c:xxx_line_number

With following comamnd, I can do it more easy
-----
(defcustom what-file-line-separator ":"
  "Define the separator between file name and line number"
  :type 'string
  :group 'editing)

(defcustom what-file-line-yankp nil
  "Toggle on/off Yank to kill ring"
  :type 'boolean
  :group 'editing)

;; Maybe this variable is useless, user can copy what they want in mini-buffer                                  
(defcustom what-file-line-fullpath t
  "Toggle on/off file name fullpath"
  :type 'boolean
  :group 'editing)

(defun what-file-line ()
  "Print the current buffer's file name and line nubmer"
  (interactive)
  (let ((n (line-number-at-pos))
        (file (buffer-file-name))
        result)
    (setq result (concat file what-file-line-separator (number-to-string n)))
    (message "%s" result)
    (if what-file-line-yankp
        (kill-new result))))
-----
Q:
1. I don't know in which group the customized variables should be put?
2. The 3rd customized variable needn't, agree?
3. If this functionality is usefull, I want to implement a GUI version(as same as gdb-mouse-set-clear-breakpoint). So when user click the left margin when non-gdb-mode, user can get the filename-line pair)
 
What's your comment?


2008-11-23 



richardeng 

[-- Attachment #2: Type: text/html, Size: 5299 bytes --]

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

* New function: what-file-line, used when writing gdb script
@ 2008-11-23  3:49 richardeng
  0 siblings, 0 replies; 2+ messages in thread
From: richardeng @ 2008-11-23  3:49 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]

Hi all,

When I write gdb script, I need to set many breakpoints. such as:
b xxx_file.c:xxx_line_number

With following comamnd, I can do it more easy
-----
(defcustom what-file-line-separator ":"
  "Define the separator between file name and line number"
  :type 'string
  :group 'editing)

(defcustom what-file-line-yankp nil
  "Toggle on/off Yank to kill ring"
  :type 'boolean
  :group 'editing)

;; Maybe this variable is useless, user can copy what they want in mini-buffer                                  
(defcustom what-file-line-fullpath t
  "Toggle on/off file name fullpath"
  :type 'boolean
  :group 'editing)

(defun what-file-line ()
  "Print the current buffer's file name and line nubmer"
  (interactive)
  (let ((n (line-number-at-pos))
        (file (buffer-file-name))
        result)
    (setq result (concat file what-file-line-separator (number-to-string n)))
    (message "%s" result)
    (if what-file-line-yankp
        (kill-new result))))
-----
Q:
1. I don't know in which group the customized variables should be put?
2. The 3rd customized variable needn't, agree?
3. If this functionality is usefull, I want to implement a GUI version(as same as gdb-mouse-set-clear-breakpoint). So when user click the left margin when non-gdb-mode, user can get the filename-line pair)

What's your comment?


2008-11-23 



richardeng 

[-- Attachment #2: Type: text/html, Size: 3960 bytes --]

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

end of thread, other threads:[~2008-11-23  3:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-23  3:49 New function: what-file-line, used when writing gdb script richardeng
  -- strict thread matches above, loose matches on Subject: below --
2008-11-01 14:20 Emacs 23 character code space Eli Zaretskii
2008-11-03  1:34 ` Kenichi Handa
2008-11-03 12:45   ` Kenichi Handa
2008-11-22 17:03     ` New function: what-file-line, used when writing gdb script richardeng

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.