branch: externals/ergoemacs-mode commit 75b9f50cf110cb1c1ad4b31b82e1986f204aac1d Author: Walter Landry <wlan...@caltech.edu> Commit: Walter Landry <wlan...@caltech.edu>
More removals --- ergoemacs-component.el | 184 ------------------------------------------- ergoemacs-key-description.el | 6 -- ergoemacs-lib.el | 3 - ergoemacs-theme-engine.el | 16 ---- 4 files changed, 209 deletions(-) diff --git a/ergoemacs-component.el b/ergoemacs-component.el index f802214..24cad71 100644 --- a/ergoemacs-component.el +++ b/ergoemacs-component.el @@ -920,141 +920,8 @@ OBJECT is the `ergoemacs-component-struct' object being changed." (error "OBJECT is not an ergoemacs-component-structure") (push (list what nil nil) (ergoemacs-component-struct-variables obj))))))) -(defun ergoemacs-component-struct--variables (&optional obj) - "Get a list of variables for the OBJ." - (let ((obj (or obj (ergoemacs-theme-components)))) - (cond - ((consp obj) - (let (ret) - (dolist (cur-obj (ergoemacs-component-struct--lookup-hash obj)) - (setq ret (append ret (ergoemacs-component-struct--variables cur-obj)))) - ret)) - ((ergoemacs-component-struct-p obj) - (mapcar (lambda(x) - (append x (list (ergoemacs-component-struct-name obj)))) - (ergoemacs-component-struct-variables obj))) - (t (ergoemacs-component-struct--variables (ergoemacs-component-struct--lookup-hash obj)))))) - (defvar ergoemacs-component-struct--refresh-variables nil) -(defun ergoemacs-component-struct--versions (&optional obj) - "Get Versions available for OBJ. -If Object isn't specified assume it is for the current ergoemacs theme." - (let ((obj (or obj (ergoemacs-theme-components obj)))) - (if (not obj) - (error "`ergoemacs-theme-components' could not be detected") - (sort (cond - ((consp obj) - (let (ret) - (dolist (cur-obj (ergoemacs-component-struct--lookup-hash obj)) - (dolist (ver (ergoemacs-component-struct-versions cur-obj)) - (unless (member ver ret) - (push ver ret)))) - ret)) - (t (ergoemacs-component-struct--versions (ergoemacs-component-struct--lookup-hash obj)))) - 'string<)))) - -(defun ergoemacs-component--regexp (&optional at-end) - "Return a regexp of `ergoemacs-mode' components. - -AT-END will append a \"$\" to the end of the regular expression." - (let (ret) - (maphash - (lambda(key _item) (push key ret)) - ergoemacs-component-hash) - (setq ret (regexp-opt ret 'symbols)) - (when at-end - (setq ret (concat ret "$"))) - ret)) - - -(defun ergoemacs-component--help-link-1 () - "Setup crosreferences for help." - (let (tmp) - ;; Link commands - (goto-char (match-beginning 0)) - (when (and (re-search-backward "\\_<\\(.*?\\)\\_> *\\=" nil t) - (setq tmp (intern (match-string 1))) - (fboundp tmp) - (commandp tmp)) - (help-xref-button 1 'help-function tmp)) - ;; Add button properties back - (when (and tmp ergoemacs-display-key-use-face-p) - (setq tmp (point)) - (beginning-of-line) - (while (and (not (looking-at "Relative To:")) (re-search-forward "\\(.*?\\)[ +]" tmp t)) - (add-text-properties (match-beginning 1) (match-end 1) '(face ergoemacs-display-key-face)))) - (end-of-line))) - -(defun ergoemacs-component--help-link () - "Links `ergoemacs-mode' components in `help-mode' buffer." - (when (eq major-mode 'help-mode) - (save-excursion - (goto-char (point-min)) - (let ((inhibit-read-only t) - (ree (format "^ - %s -- " (ergoemacs-component--regexp))) - (ret (format "^\"%s\" - " (ergoemacs-theme--regexp))) - (re (ergoemacs-component--regexp t)) - (rem (ergoemacs-map-properties--map-regexp t)) - (rel1 (ergoemacs-layout--regexp)) - (rel2 (ergoemacs-layout--regexp 2)) - tmp) - (with-syntax-table emacs-lisp-mode-syntax-table - (when (re-search-forward "^\\(\\_<.*\\_>\\) is .* component defined in `\\(.*\\)'" nil t) - (help-xref-button 2 'ergoemacs-component-def (match-string 1))) - (goto-char (point-min)) - (while (re-search-forward rel1 nil t) - (help-xref-button 1 'ergoemacs-layout-help (match-string 1))) - (goto-char (point-min)) - (while (re-search-forward rel2 nil t) - (help-xref-button 1 'ergoemacs-layout-help (match-string 1))) - (goto-char (point-min)) - (when (re-search-forward "^\\(\\_<.*\\_>\\) is .* component defined in `\\(.*\\)'" nil t) - (help-xref-button 2 'ergoemacs-component-def (match-string 1))) - (goto-char (point-min)) - (while (re-search-forward "\\(Variable Prefixes:\\|Unbound keys:\\|Masked emacs keys:\\) +" nil t) - (while (and (not (looking-at " *$")) (re-search-forward "\\(.*?\\)\\(, +\\| *$\\|[+ ]+\\)" (point-at-eol) t)) - (add-text-properties (match-beginning 1) (match-end 1) '(face ergoemacs-display-key-face)))) - (goto-char (point-min)) - (when (re-search-forward "^\\(\\_<.*\\_>\\) is .* theme defined in `\\(.*\\)'" nil t) - (help-xref-button 2 'ergoemacs-theme-def (match-string 1))) - (goto-char (point-min)) - (when (re-search-forward "^This theme is based on: *\\(\\_<.*\\_>\\)" nil t) - (help-xref-button 1 'ergoemacs-theme-help (match-string 1))) - (goto-char (point-min)) - (while (re-search-forward ret nil t) - (help-xref-button 1 'ergoemacs-theme-help (match-string 1))) - (goto-char (point-min)) - (while (re-search-forward ree nil t) - (help-xref-button 1 'ergoemacs-component-help (match-string 1))) - (goto-char (point-min)) - (while (re-search-forward re nil t) - (help-xref-button 1 'ergoemacs-component-help (match-string 1)) - (ergoemacs-component--help-link-1)) - (goto-char (point-min)) - (while (re-search-forward rem nil t) - (when (and (setq tmp (intern (match-string 1))) - (boundp tmp)) - (help-xref-button 1 'help-variable tmp)) - (ergoemacs-component--help-link-1)) - (goto-char (point-min)) - (when (search-forward "an `ergoemacs-mode' layout defined" nil t) - (setq bidi-display-reordering nil))))))) - -(defcustom ergoemacs-component-find-regexp - (concat"^\\s-*(ergoemacs-\\(?:theme-?\\)?\\(?:component\\|package\\|autoload\\)?" find-function-space-re "%s\\(\\s-\\|$\\)") - "The regexp used to search for a component definition. - -This is used by `ergoemacs-find-component' and it must contain a -`%s' at the place where `format' should insert the compenent -name." - :type 'regexp - :group 'find-function - :version "22.1") - -(unless (assoc 'ergoemacs-component find-function-regexp-alist) - (push (cons 'ergoemacs-component 'ergoemacs-component-find-regexp) find-function-regexp-alist)) - (defun ergoemacs-component-find-no-select (component &optional type) "Find COMPONENT of TYPE. @@ -1079,57 +946,6 @@ TYPE can be 'ergoemacs-theme, if not it defaults to a single component." sym (or type 'ergoemacs-component) el-file))) loc))) -(defun ergoemacs-component-find-1 (symbol type switch-fn &optional buffer-point) - "Find `ergoemacs-mode' component or theme. - -SYMBOL is the symbol representing the component or theme. - -TYPE is nil to search for a component definition, or -'ergoemacs-theme, to find the theme. - -The variable `find-function-recenter-line' controls how -to recenter the display. SWITCH-FN is the function to call -to display and select the buffer. -See also `find-function-after-hook'. - -BUFFER-POINT is the point to move to. If it isn't specified, -find it with `ergoemacs-component-find-no-select'. - -Modified from `find-definition-noselect'. - -Set mark before moving, if the buffer already existed." - (let* ((orig-point (point)) - (orig-buffers (buffer-list)) - (buffer-point (or buffer-point - (save-excursion - (ergoemacs-component-find-no-select symbol type)))) - (new-buf (car buffer-point)) - (new-point (cdr buffer-point))) - (when buffer-point - (when (memq new-buf orig-buffers) - (push-mark orig-point)) - (funcall switch-fn new-buf) - (when new-point (goto-char new-point)) - (recenter find-function-recenter-line) - (run-hooks 'find-function-after-hook)))) - -(defun ergoemacs-component-find-definition (component) - "Find the definition of COMPONENT. COMPONENT defaults to the name near point. - -Finds the `ergoemacs-mode' containing the definition of the component -near point (selected by `ergoemacs-component-at-point') in a buffer and -places point before the definition. - -Set mark before moving, if the buffer already existed. - -The library where FACE is defined is searched for in -`find-function-source-path', if non-nil, otherwise in `load-path'. -See also `find-function-recenter-line' and `find-function-after-hook'." - (interactive (list (ergoemacs-component-at-point))) - (ergoemacs-component-find-1 component 'ergoemacs-component 'switch-to-buffer)) - - - (defun ergoemacs-component-at-point (&optional theme-instead) "Get the `ergoemacs-component' defined at or before point. diff --git a/ergoemacs-key-description.el b/ergoemacs-key-description.el index eafa356..5cb940d 100644 --- a/ergoemacs-key-description.el +++ b/ergoemacs-key-description.el @@ -446,12 +446,6 @@ KBD is the keyboard code. LAYOUT is the layout that is used." (setq ret (cons 'ergoemacs-component-help (nth 1 ret))))) ret)) -(defun ergoemacs-key-description--setup-xrefs () - "Setup cross refences in help buffer." - (ergoemacs-component--help-link)) - -(add-hook 'temp-buffer-show-hook 'ergoemacs-key-description--setup-xrefs) - (defun ergoemacs-key-description--keymap-item (&optional elt keymap help) "Get keymap description for ELT based on KEYMAP. diff --git a/ergoemacs-lib.el b/ergoemacs-lib.el index cba1675..b1198bb 100644 --- a/ergoemacs-lib.el +++ b/ergoemacs-lib.el @@ -63,9 +63,6 @@ (declare-function ergoemacs-translate--ahk-ini "ergoemacs-translate") (declare-function ergoemacs-command-loop--spinner-display "ergoemacs-command-loop") -(declare-function ergoemacs-component-find-definition "ergoemacs-component") -(declare-function ergoemacs-component-find-1 "ergoemacs-component") - (defun ergoemacs-setcdr (var val &optional default) "Use `setcdr' on VAL to VAL. If VAL is a symbol, use `ergoemacs-sv' to determine the value. diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el index 1ee8c79..e1ddbe6 100644 --- a/ergoemacs-theme-engine.el +++ b/ergoemacs-theme-engine.el @@ -70,7 +70,6 @@ (declare-function ergoemacs-mode-reset "ergoemacs-mode") (declare-function ergoemacs-component-struct--component-description "ergoemacs-component") (declare-function ergoemacs-component-at-point "ergoemacs-component") -(declare-function ergoemacs-component-find-1 "ergoemacs-component") (declare-function ergoemacs-require "ergoemacs-lib") (declare-function ergoemacs-command-loop--spinner-display "ergoemacs-command-loop") (declare-function ergoemacs-key-description "ergoemacs-key-description") @@ -249,21 +248,6 @@ should insert the face name." (defvar ergoemacs-theme--svg-list nil) -(defun ergoemacs-theme-find-definition (theme) - "Find the definition of THEME. THEME defaults to the name near point. - -Finds the `ergoemacs-mode' containing the definition of the component -near point (selected by `ergoemacs-theme-at-point') in a buffer and -places point before the definition. - -Set mark before moving, if the buffer already existed. - -The library where FACE is defined is searched for in -`find-function-source-path', if non-nil, otherwise in `load-path'. -See also `find-function-recenter-line' and `find-function-after-hook'." - (interactive (list (ergoemacs-theme-at-point))) - (ergoemacs-component-find-1 theme 'ergoemacs-theme 'switch-to-buffer)) - (defun ergoemacs-theme-describe () "Display the full documentation for Ergoemacs." (interactive)