<commit_before>;;; rdebug-breaks.el --- Ruby debugger frames buffer

;; Copyright (C) 2008 <NAME> (<EMAIL>)
;; Copyright (C) 2008 <NAME>

;; $Id$

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;; This file contains code dealing with the breakpoints secondary buffer.

;;; Code:

(require 'rdebug-dbg)
(require 'rdebug-gud)
(require 'rdebug-regexp)
(require 'rdebug-secondary)
(require 'rdebug-source)
(require 'rdebug-vars)

(defun rdebug-display-breakpoints-buffer ()
  "Display the rdebug breakpoints buffer."
  (interactive)
  (rdebug-display-secondary-buffer "breakpoints"))

(defvar rdebug-breakpoints-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map [mouse-2] 'rdebug-goto-breakpoint-mouse)
    (define-key map [mouse-3] 'rdebug-goto-breakpoint-mouse)
    (define-key map "t" 'rdebug-toggle-breakpoint)
    (define-key map "i" 'rdebug-add-breakpoint-condition)
    (define-key map [insert] 'rdebug-add-breakpoint-condition)
    (define-key map "\C-x\C-e" 'gud-print) ; FIXME show expression in msg area
    (rdebug-populate-digit-keys map)
    (define-key map [(control m)] 'rdebug-goto-breakpoint)
    (define-key map [?d] 'rdebug-delete-breakpoint)
    (rdebug-populate-secondary-buffer-map map)

    ;; --------------------
    ;; The "Breakpoints window" submenu.
    (let ((submenu (make-sparse-keymap)))
      (define-key-after map [menu-bar debugger breakpoints]
        (cons "Breakpoints window" submenu)
        'placeholder))

    (define-key map [menu-bar debugger breakpoints toggle]
      '(menu-item "Toggle breakpoint" rdebug-toggle-breakpoint))

    (define-key map [menu-bar debugger breakpoints goto]
      '(menu-item "Goto breakpoint" rdebug-goto-breakpoint))

    (define-key map [menu-bar debugger breakpoints delete]
      '(menu-item "Delete breakpoint" rdebug-delete-breakpoint))

    map)
  "Keymap to navigate/set/enable rdebug breakpoints.")

;; Here the "anchored match" method is used, see `font-lock-keywords'
;; for details.
(defvar rdebug-breakpoints-font-lock-keywords
  '(("\\([0-9]+\\) +\\(\\(n\\)\\|\\(y\\)\\) +at "
     (1 font-lock-constant-face)
     (3 font-lock-type-face    nil t)   ; t = ok if not present
     (4 font-lock-warning-face nil t)   ; ditto.
     ;; File name and line
     ("\\([-a-zA-Z0-9/_:.]+\\):[0-9]+$"
      nil                               ; Preform (not used)
      nil                               ; Postfrom (not used)
      (1 font-lock-warning-face))
     ;; Class:function
     ("\\([a-zA-Z0-9_]*\\):\\([a-zA-Z_][a-zA-Z0-9_]+\\)$"
      nil                               ; Preform (not used)
      nil                               ; Postfrom (not used)
      (1 font-lock-type-face)
      (2 font-lock-function-name-face))))
  "Rules for coloring the rdebug breakpoints buffer.")

(defun rdebug-breakpoints-mode ()<commit_msg>Breakpoints font-lock rules even more generous, now all characters are matched.<commit_after>;;; rdebug-breaks.el --- Ruby debugger frames buffer

;; Copyright (C) 2008 <NAME> (<EMAIL>)
;; Copyright (C) 2008 <NAME>

;; $Id$

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;; This file contains code dealing with the breakpoints secondary buffer.

;;; Code:

(require 'rdebug-dbg)
(require 'rdebug-gud)
(require 'rdebug-regexp)
(require 'rdebug-secondary)
(require 'rdebug-source)
(require 'rdebug-vars)

(defun rdebug-display-breakpoints-buffer ()
  "Display the rdebug breakpoints buffer."
  (interactive)
  (rdebug-display-secondary-buffer "breakpoints"))

(defvar rdebug-breakpoints-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map [mouse-2] 'rdebug-goto-breakpoint-mouse)
    (define-key map [mouse-3] 'rdebug-goto-breakpoint-mouse)
    (define-key map "t" 'rdebug-toggle-breakpoint)
    (define-key map "i" 'rdebug-add-breakpoint-condition)
    (define-key map [insert] 'rdebug-add-breakpoint-condition)
    (define-key map "\C-x\C-e" 'gud-print) ; FIXME show expression in msg area
    (rdebug-populate-digit-keys map)
    (define-key map [(control m)] 'rdebug-goto-breakpoint)
    (define-key map [?d] 'rdebug-delete-breakpoint)
    (rdebug-populate-secondary-buffer-map map)

    ;; --------------------
    ;; The "Breakpoints window" submenu.
    (let ((submenu (make-sparse-keymap)))
      (define-key-after map [menu-bar debugger breakpoints]
        (cons "Breakpoints window" submenu)
        'placeholder))

    (define-key map [menu-bar debugger breakpoints toggle]
      '(menu-item "Toggle breakpoint" rdebug-toggle-breakpoint))

    (define-key map [menu-bar debugger breakpoints goto]
      '(menu-item "Goto breakpoint" rdebug-goto-breakpoint))

    (define-key map [menu-bar debugger breakpoints delete]
      '(menu-item "Delete breakpoint" rdebug-delete-breakpoint))

    map)
  "Keymap to navigate/set/enable rdebug breakpoints.")

;; Here the "anchored match" method is used, see `font-lock-keywords'
;; for details.
(defvar rdebug-breakpoints-font-lock-keywords
  '(("\\([0-9]+\\) +\\(\\(n\\)\\|\\(y\\)\\) +at "
     (1 font-lock-constant-face)
     (3 font-lock-type-face    nil t)   ; t = ok if not present
     (4 font-lock-warning-face nil t)   ; ditto.
     ;; File name and line
     ("\\(.*\\):[0-9]+$"
      nil                               ; Preform (not used)
      nil                               ; Postfrom (not used)
      (1 font-lock-warning-face))
     ;; Class:function
     ("\\(.*\\):\\([a-zA-Z_].+\\)$"
      nil                               ; Preform (not used)
      nil                               ; Postfrom (not used)
      (1 font-lock-type-face)
      (2 font-lock-function-name-face))))
  "Rules for coloring the rdebug breakpoints buffer.")

(defun rdebug-breakpoints-mode ()
{'fraction_non_alphanumeric': 0.14245216158752658, 'fraction_numerical': 0.010772501771793055, 'mean_word_length': 2.864184008762322, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4402566', 'n_tokens_mistral': 2282, 'n_tokens_neox': 2201, 'n_words': 680}