ruby-changes:54244
From: hsbt <ko1@a...>
Date: Thu, 20 Dec 2018 13:57:11 +0900 (JST)
Subject: [ruby-changes:54244] hsbt:r64741 (trunk): Removed old elisp files. New upstream repository was moved https://github.com/ruby/elisp.
hsbt 2018-09-14 21:34:50 +0900 (Fri, 14 Sep 2018) New Revision: 64741 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64741 Log: Removed old elisp files. New upstream repository was moved https://github.com/ruby/elisp. Removed files: trunk/misc/inf-ruby.el trunk/misc/rdoc-mode.el trunk/misc/ruby-additional.el trunk/misc/ruby-electric.el trunk/misc/ruby-style.el trunk/misc/rubydb2x.el trunk/misc/rubydb3x.el Modified files: trunk/misc/README Index: misc/ruby-additional.el =================================================================== --- misc/ruby-additional.el (revision 64740) +++ misc/ruby-additional.el (nonexistent) @@ -1,181 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/misc/ruby-additional.el#L0 -;;; ruby-additional.el --- ruby-mode extensions yet to be merged into Emacs - -;; Authors: Yukihiro Matsumoto, Nobuyoshi Nakada, Akinori MUSHA -;; URL: https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/ -;; Created: 3 Sep 2012 -;; Package-Requires: ((emacs "24.3") (ruby-mode "1.2")) -;; Keywords: ruby, languages - -;;; Commentary: -;; -;; This package contains ruby-mode extensions yet to be merged into -;; the latest released version of Emacs distribution. For older -;; versions of Emacs, use ruby-mode.el bundled with CRuby. - -;;; Code: - -(eval-when-compile - (require 'ruby-mode)) - -(eval-after-load 'ruby-mode - '(progn - (define-key ruby-mode-map "\C-c\C-e" 'ruby-insert-end) - - (defun ruby-insert-end () - (interactive) - (if (eq (char-syntax (preceding-char)) ?w) - (insert " ")) - (insert "end") - (save-excursion - (if (eq (char-syntax (following-char)) ?w) - (insert " ")) - (ruby-indent-line t) - (end-of-line))) - - (defconst ruby-default-encoding-map - '((us-ascii . nil) ;; Do not put coding: us-ascii - (utf-8 . nil) ;; Do not put coding: utf-8 - (shift-jis . cp932) ;; Emacs charset name of Shift_JIS - (shift_jis . cp932) ;; MIME charset name of Shift_JIS - (japanese-cp932 . cp932)) ;; Emacs charset name of CP932 - ) - - (custom-set-default 'ruby-encoding-map ruby-default-encoding-map) - - (defcustom ruby-encoding-map ruby-default-encoding-map - "Alist to map encoding name from Emacs to Ruby. -Associating an encoding name with nil means it needs not be -explicitly declared in magic comment." - :type '(repeat (cons (symbol :tag "From") (symbol :tag "To"))) - :group 'ruby) - - (defun ruby-mode-set-encoding () - "Insert or update a magic comment header with the proper encoding. -`ruby-encoding-map' is looked up to convert an encoding name from -Emacs to Ruby." - (let* ((nonascii - (save-excursion - (widen) - (goto-char (point-min)) - (re-search-forward "[^\0-\177]" nil t))) - (coding-system - (or coding-system-for-write - buffer-file-coding-system)) - (coding-system - (and coding-system - (coding-system-change-eol-conversion coding-system nil))) - (coding-system - (and coding-system - (or - (coding-system-get coding-system :mime-charset) - (let ((coding-type (coding-system-get coding-system :coding-type))) - (cond ((eq coding-type 'undecided) - (if nonascii - (or (and (coding-system-get coding-system :prefer-utf-8) - 'utf-8) - (coding-system-get default-buffer-file-coding-system :coding-type) - 'ascii-8bit))) - ((memq coding-type '(utf-8 shift-jis)) - coding-type) - (t coding-system)))))) - (coding-system - (or coding-system - 'us-ascii)) - (coding-system - (let ((cons (assq coding-system ruby-encoding-map))) - (if cons (cdr cons) coding-system))) - (coding-system - (and coding-system - (symbol-name coding-system)))) - (if coding-system - (save-excursion - (widen) - (goto-char (point-min)) - (if (looking-at "^#!") (beginning-of-line 2)) - (cond ((looking-at "\\s *#.*-\*-\\s *\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]*\\)\\s *\\(;\\|-\*-\\)") - (unless (string= (match-string 2) coding-system) - (goto-char (match-beginning 2)) - (delete-region (point) (match-end 2)) - (and (looking-at "-\*-") - (let ((n (skip-chars-backward " "))) - (cond ((= n 0) (insert " ") (backward-char)) - ((= n -1) (insert " ")) - ((forward-char))))) - (insert coding-system))) - ((looking-at "\\s *#.*coding\\s *[:=]")) - (t (when ruby-insert-encoding-magic-comment - (insert "# -*- coding: " coding-system " -*-\n")))))))) - - (define-key ruby-mode-map "\C-cU" 'ruby-encode-decode-unicode) - - (defun ruby-encode-unicode (beg end) - "Convert non-ascii string in the given region to \\u{} form." - (interactive "r") - (setq end (set-marker (make-marker) end)) - (goto-char beg) - (while (and (< (point) end) - (re-search-forward "\\([\C-@-\C-I\C-K\C-_\C-?]+\\)\\|[^\C-@-\C-?]+" end t)) - (let ((str (match-string-no-properties 0)) sep b e f) - (if (match-beginning 1) - (setq b "" e "" sep "" - f (lambda (c) - (cond ((= c ?\t) "\\t") - ((= c ?\r) "\\r") - ((= c ?\e) "\\e") - ((= c ?\f) "\\f") - ((= c ?\b) "\\b") - ((= c ?\v) "\\v") - ((= c ?\C-?) "\\c?") - ((concat "\\c" (char-to-string (logior c #x40))))))) - (setq b "\\u{" e "}" sep " " f (lambda (c) (format "%x" c)))) - (setq str (mapconcat f str sep)) - (delete-region (match-beginning 0) (match-end 0)) - (insert b str e)))) - - (defun ruby-decode-unicode (beg end) - "Convert escaped Unicode in the given region to raw string." - (interactive "r") - (setq end (set-marker (make-marker) end)) - (goto-char beg) - (while (and (< (point) end) - (re-search-forward "\\\\u\\([0-9a-fA-F]\\{4\\}\\)\\|\\\\u{\\([0-9a-fA-F \t]+\\)}" end t)) - (let ((b (match-beginning 0)) (e (match-end 0)) - (s (match-string-no-properties 1))) - (if s - (setq s (cons s nil)) - (goto-char (match-beginning 2)) - (while (looking-at "[ \t]*\\([0-9a-fA-F]+\\)") - (setq s (cons (match-string-no-properties 1) s)) - (goto-char (match-end 0)))) - (setq s (mapconcat (lambda (c) (format "%c" (string-to-int c 16))) - (nreverse s) "")) - (delete-region b e) - (insert s)) - )) - - (defun ruby-encode-decode-unicode (dec beg end) - "Convert Unicode <-> \\u{} in the given region." - (interactive "P\nr") - (if dec (ruby-decode-unicode beg end) (ruby-encode-unicode beg end))) - - (defun ruby-insert-heredoc-code-block (arg) - "Insert indented here document code block" - (interactive "P") - (let ((c (if arg "~" "-"))) - (insert "\"#{<<" c "\"{#\"}\\n#{<<" c "'};'}\"")) - (end-of-line) - (if (eobp) (insert "\n") (forward-char)) - (indent-region (point) - (progn (insert "{#\n" "};\n") (point))) - (beginning-of-line 0)) - (define-key ruby-mode-map "\C-cH" 'ruby-insert-heredoc-code-block) - )) - -;; monkey-patching ruby-mode.el in Emacs 24, as r49872. -(when (and (boundp 'ruby-syntax-before-regexp-re) - (not (string-match ruby-syntax-before-regexp-re "foo {|" 1))) - (replace-regexp-in-string "\\[\\[" "\\&{|" ruby-syntax-before-regexp-re)) - -(provide 'ruby-additional) - -;;; ruby-additional.el ends here Property changes on: misc/ruby-additional.el ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -LF \ No newline at end of property Index: misc/rdoc-mode.el =================================================================== --- misc/rdoc-mode.el (revision 64740) +++ misc/rdoc-mode.el (nonexistent) @@ -1,166 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/misc/rdoc-mode.el#L0 -;; -;; rdoc-mode.el -;; Major mode for RDoc editing -;; - -;; Created: Fri Sep 18 09:04:49 JST 2009 - -;; License: Ruby's - -(require 'derived) - -;;;###autoload -(define-derived-mode rdoc-mode text-mode "RDoc" - "Major mode for RD editing. -\\{rdoc-mode-map}" - (make-local-variable 'paragraph-separate) - (setq paragraph-separate "^\\(=+\\|\\*+\\)[ \t\v\f]*\\|^\\s *$") - (make-local-variable 'paragraph-start) - (setq paragraph-start paragraph-separate) - (make-local-variable 'require-final-newline) - (setq require-final-newline t) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '((rdoc-font-lock-keywords) t nil)) - (make-local-variable 'font-lock-keywords) - (setq font-lock-keywords rdoc-font-lock-keywords) - (make-local-variable 'outline-regexp) - (setq outline-regexp "^\\(=+\\)[ \t\v\f]*") - (outline-minor-mode t) - (setq show-trailing-whitespace t) - (rdoc-setup-keys) - (setq indent-tabs-mode nil) - (run-hooks 'rdoc-mode-hook) - ) - -(defun rdoc-fill-paragraph (&optional justify region) - "Fills paragraph, except for cited region" - (interactive (progn - (barf-if-buffer-read-only) - (list (if current-prefix-arg 'full)))) - (save-excursion - (beginning-of-line) - (save-restriction - (let ((pos (point)) beg end indent hanging) - (cond - ((looking-at "^ +\\(\\*\\s *\\)") - (setq indent (- (match-end 0) (match-beginning 0)) - hanging (- (match-end 1) (match-beginning 1)))) - ((looking-at "^ +") - (setq indent (- (match-end 0) (match-beginning 0))) - (when (and (re-search-backward "^[^ ]\\|^\\( *\\(\\* *\\)\\)" nil t) - (match-beginning 1) - (= indent (- (match-end 1) (match-beginning 1)))) - (setq hanging (- (match-end 2) (match-beginning 2))) - (setq beg (match-beginning 1)))) - ((setq beg t))) - (when beg - (when indent - (goto-char pos) - (while (progn (beginning-of-line 2) - (and (looking-at "^\\( +\\)\\S ") - (= indent (- (match-end 1) (match-beginning 1)))))) - (setq end (point)) - (when (and beg (not region)) - (setq region (list beg end)) - (narrow-to-region beg end) - )) - (goto-char pos) - (fill-paragraph justify region) - (when (and indent - (or (goto-char beg) t) - (or (beginning-of-line 2) t) - (looking-at "^\\( +\\)") - (= (- indent hanging) (- (match-end 0) (match-beginning 0)))) - (insert-char ?\s hanging) - (beginning-of-line) - (narrow-to-region (point) end) - (fill-paragraph justify (list (point) end)))))))) - -(defun rdoc-setup-keys () - (interactive) - (define-key rdoc-mode-map "\M-q" 'rdoc-fill-paragraph) - ) - -(defvar rdoc-heading1-face 'font-lock-keywordoc-face) -(defvar rdoc-heading2-face 'font-lock-type-face) -(defvar rdoc-heading3-face 'font-lock-variable-name-face) -(defvar rdoc-heading4-face 'font-lock-comment-face) -(defvar rdoc-bold-face 'font-lock-function-name-face) -(defvar rdoc-emphasis-face 'font-lock-function-name-face) -(defvar rdoc-code-face 'font-lock-keyword-face) -(defvar rdoc-description-face 'font-lock-constant-face) - -(defvar rdoc-font-lock-keywords - (list - (list "^=([^=\r\n].*)?$" - 0 rdoc-heading1-face) - (list "^==([^=\r\n].*)?$" - 0 rdoc-heading2-face) - (list "^===([^=\r\n].*)?$" - 0 rdoc-heading3-face) - (list "^====+.*$" - 0 rdoc-heading4-face) - (list "\\(^\\|[ \t\v\f]\\)\\(\\*\\(\\sw\\|[-_:]\\)+\\*\\)\\($\\|[ \t\v\f]\\)" - 2 rdoc-bold-face) ; *bold* - (list "\\(^\\|[ \t\v\f]\\)\\(_\\(\\sw\\|[-_:]\\)+_\\)\\($\\|[ \t\v\f]\\)" - 2 rdoc-emphasis-face) ; _emphasis_ - (list "\\(^\\|[ \t\v\f]\\)\\(\\+\\(\\sw\\|[-_:]\\)+\\+\\)\\($\\|[ \t\v\f]\\)" - 2 rdoc-code-face) ; +code+ - (list "<em>[^<>]*</em>" 0 rdoc-emphasis-face) - (list "<i>[^<>]*</i>" 0 rdoc-emphasis-face) - (list "<b>[^<>]*</b>" 0 rdoc-bold-face) - (list "<tt>[^<>]*</tt>" 0 rdoc-code-face) - (list "<code>[^<>]*</code>" 0 rdoc-code-face) - (list "^\\([-*]\\|[0-9]+\\.\\|[A-Za-z]\\.\\)\\s " - 1 rdoc-description-face) ; bullet | numbered | alphabetically numbered - (list "^\\[[^\]]*\\]\\|\\S .*::\\)\\([ \t\v\f]\\|$\\)" - 1 rdoc-description-face) ; labeled | node - ;(list "^[ \t\v\f]+\\(.*\\)" 1 rdoc-verbatim-face) - )) - -(defun rdoc-imenu-create-index () - (let ((root '(nil . nil)) - cur-alist - (cur-level 0) - (pattern (concat outline-regexp "\\(.*?\\)[ \t\v\f]*$")) - (empty-heading "-") - (self-heading ".") - pos level heading alist) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward pattern (point-max) t) - (setq heading (match-string-no-properties 2) - level (min 6 (length (match-string-no-properties 1))) - pos (match-beginning 1)) - (if (= (length heading) 0) - (setq heading empty-heading)) - (setq alist (list (cons heading pos))) - (cond - ((= cur-level level) ; new sibling - (setcdr cur-alist alist) - (setq cur-alist alist)) - ((< cur-level level) ; first child - (dotimes (i (- level cur-level 1)) - (setq alist (list (cons empty-heading alist)))) - (if cur-alist - (let* ((parent (car cur-alist)) - (self-pos (cdr parent))) - (setcdr parent (cons (cons self-heading self-pos) alist))) - (setcdr root alist)) ; primogenitor - (setq cur-alist alist - cur-level level)) - (t ; new sibling of an ancestor - (let ((sibling-alist (last (cdr root)))) - (dotimes (i (1- level)) - (setq sibling-alist (last (cdar sibling-alist)))) - (setcdr sibling-alist alist) - (setq cur-alist alist - cur-level level)))))) - (cdr root))) - -(defun rdoc-set-imenu-create-index-function () - (setq imenu-create-index-function 'rdoc-imenu-create-index)) - -(add-hook 'rdoc-mode-hook 'rdoc-set-imenu-create-index-function) - -(provide 'rdoc-mode) Property changes on: misc/rdoc-mode.el ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -LF \ No newline at end of property Index: misc/ruby-electric.el =================================================================== --- misc/ruby-electric.el (revision 64740) +++ misc/ruby-electric.el (nonexistent) @@ -1,583 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/misc/ruby-electric.el#L0 -;;; ruby-electric.el --- Minor mode for electrically editing ruby code -;; -;; Authors: Dee Zsombor <dee dot zsombor at gmail dot com> -;; Yukihiro Matsumoto -;; Nobuyoshi Nakada -;; Akinori MUSHA <knu@i...> -;; Jakub Ku添ma <qoobaa@g...> -;; Maintainer: Akinori MUSHA <knu@i...> -;; Created: 6 Mar 2005 -;; URL: https://github.com/knu/ruby-electric.el -;; Keywords: languages ruby -;; License: The same license terms as Ruby -;; Version: 2.3.1 - -;;; Commentary: -;; -;; `ruby-electric-mode' accelerates code writing in ruby by making -;; some keys "electric" and automatically supplying with closing -;; parentheses and "end" as appropriate. -;; -;; This work was originally inspired by a code snippet posted by -;; [Frederick Ros](https://github.com/sleeper). -;; -;; Add the following line to enable ruby-electric-mode under -;; ruby-mode. -;; -;; (eval-after-load "ruby-mode" -;; '(add-hook 'ruby-mode-hook 'ruby-electric-mode)) -;; -;; Type M-x customize-group ruby-electric for configuration. - -;;; Code: - -(require 'ruby-mode) - -(eval-when-compile - (require 'cl)) - -(defgroup ruby-electric nil - "Minor mode providing electric editing commands for ruby files" - :group 'ruby) - -(defconst ruby-electric-expandable-bar-re - "\\s-\\(do\\|{\\)\\s-*|") - -(defconst ruby-electric-delimiters-alist - '((?\{ :name "Curly brace" :handler ruby-electric-curlies :closing ?\}) - (?\[ :name "Square brace" :handler ruby-electric-matching-char :closing ?\]) - (?\( :name "Round brace" :handler ruby-electric-matching-char :closing ?\)) - (?\' :name "Quote" :handler ruby-electric-matching-char) - (?\" :name "Double quote" :handler ruby-electric-matching-char) - (?\` :name "Back quote" :handler ruby-electric-matching-char) - (?\| :name "Vertical bar" :handler ruby-electric-bar) - (?\# :name "Hash" :handler ruby-electric-hash))) - -(defvar ruby-electric-matching-delimeter-alist - (apply 'nconc - (mapcar #'(lambda (x) - (let ((delim (car x)) - (plist (cdr x))) - (if (eq (plist-get plist :handler) 'ruby-electric-matching-char) - (list (cons delim (or (plist-get plist :closing) - delim)))))) - ruby-electric-delimiters-alist))) - -(defvar ruby-electric-expandable-keyword-re) - -(defmacro ruby-electric--try-insert-and-do (string &rest body) - (declare (indent 1)) - `(let ((before (point)) - (after (progn - (insert ,string) - (point)))) - (unwind-protect - (progn ,@body) - (delete-region before after) - (goto-char before)))) - -(defconst ruby-modifier-beg-symbol-re - (regexp-opt ruby-modifier-beg-keywords 'symbols)) - -(defun ruby-electric--modifier-keyword-at-point-p () - "Test if there is a modifier keyword at point." - (and (looking-at ruby-modifier-beg-symbol-re) - (let ((end (match-end 1))) - (not (looking-back "\\.")) - (save-excursion - (let ((indent1 (ruby-electric--try-insert-and-do "\n" - (ruby-calculate-indent))) - (indent2 (save-excursion - (goto-char end) - (ruby-electric--try-insert-and-do " x\n" - (ruby-calculate-indent))))) - (= indent1 indent2)))))) - -(defconst ruby-block-mid-symbol-re - (regexp-opt ruby-block-mid-keywords 'symbols)) - -(defun ruby-electric--block-mid-keyword-at-point-p () - "Test if there is a block mid keyword at point." - (and (looking-at ruby-block-mid-symbol-re) - (looking-back "^\\s-*"))) - -(defconst ruby-block-beg-symbol-re - (regexp-opt ruby-block-beg-keywords 'symbols)) - -(defun ruby-electric--block-beg-keyword-at-point-p () - "Test if there is a block beginning keyword at point." - (and (looking-at ruby-block-beg-symbol-re) - (if (string= (match-string 1) "do") - (looking-back "\\s-") - (not (looking-back "\\."))) - ;; (not (ruby-electric--modifier-keyword-at-point-p)) ;; implicit assumption - )) - -(defcustom ruby-electric-keywords-alist - '(("begin" . end) - ("case" . end) - ("class" . end) - ("def" . end) - ("do" . end) - ("else" . reindent) - ("elsif" . reindent) - ("end" . reindent) - ("ensure" . reindent) - ("for" . end) - ("if" . end) - ("module" . end) - ("rescue" . reindent) - ("unless" . end) - ("until" . end) - ("when" . reindent) - ("while" . end)) - "Alist of keywords and actions to define how to react to space -or return right after each keyword. In each (KEYWORD . ACTION) -cons, ACTION can be set to one of the following values: - - `reindent' Reindent the line. - - `end' Reindent the line and auto-close the keyword with - end if applicable. - - `nil' Do nothing. -" - :type '(repeat (cons (string :tag "Keyword") - (choice :tag "Action" - :menu-tag "Action" - (const :tag "Auto-close with end" - (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/