Remove unused/useless lisp functions

This commit is contained in:
Ivan Malison 2016-06-21 14:46:38 -07:00
parent 84e8b318af
commit 81bfd310fc

View File

@ -806,10 +806,6 @@ A macro for composing functions together to build an interactive command to copy
`(setq ,name ,value) `(setq ,name ,value)
`(defvar ,name ,value))) `(defvar ,name ,value)))
(defmacro defvar-if-non-existent (name value)
(unless (boundp name)
`(defvar ,name ,value)))
(defun eval-region-or-last-sexp () (defun eval-region-or-last-sexp ()
(interactive) (interactive)
(if (region-active-p) (call-interactively 'eval-region) (if (region-active-p) (call-interactively 'eval-region)
@ -844,43 +840,11 @@ A macro for composing functions together to build an interactive command to copy
(let ((fill-column (if unfill (point-max) fill-column))) (let ((fill-column (if unfill (point-max) fill-column)))
(fill-paragraph nil region))) (fill-paragraph nil region)))
(defun sudo-edit (&optional arg)
"Edit currently visited file as root.
With a prefix ARG prompt for a file to visit.
Will also prompt for a file to visit if current
buffer is not visiting a file."
(interactive "P")
(if (or arg (not buffer-file-name))
(find-file (concat "/sudo:root@localhost:"
(ido-read-file-name "Find file (as root): ")))
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
(defun frame-exists () (defun frame-exists ()
(cl-find-if (cl-find-if
(lambda (frame) (lambda (frame)
(assoc 'display (frame-parameters frame))) (frame-list))) (assoc 'display (frame-parameters frame))) (frame-list)))
(defun imalison:copy-shell-command-on-region (start end command)
(interactive (list (region-beginning) (region-end)
(read-shell-command "Shell command on region: ")))
(let ((original-buffer (current-buffer)))
(with-temp-buffer
(let ((temp-buffer (current-buffer)))
(with-current-buffer original-buffer
(shell-command-on-region start end command temp-buffer))
(kill-ring-save (point-max) (point-min))))))
(defun imalison:shell-command-on-region-replace (start end command)
(interactive (list (region-beginning) (region-end)
(read-shell-command "Shell command on region: ")))
(shell-command-on-region start end command nil t))
(defun imalison:shell-command-on-region (arg)
(interactive "P")
(call-interactively (if arg 'imalison:shell-command-on-region-replace
'imalison:copy-shell-command-on-region)))
(defun make-frame-if-none-exists () (defun make-frame-if-none-exists ()
(let* ((existing-frame (frame-exists))) (let* ((existing-frame (frame-exists)))
(if existing-frame (if existing-frame
@ -1294,9 +1258,9 @@ Sets environment variables by starting a shell
(setq org-ehtml-everything-editable t))) (setq org-ehtml-everything-editable t)))
;; Agenda setup. ;; Agenda setup.
(defvar-if-non-existent imalison:org-gtd-file "~/org/gtd.org") (defvar-setq imalison:org-gtd-file "~/org/gtd.org")
(defvar-if-non-existent imalison:org-habits-file "~/org/habits.org") (defvar-setq imalison:org-habits-file "~/org/habits.org")
(defvar-if-non-existent imalison:org-calendar-file "~/org/calendar.org") (defvar-setq imalison:org-calendar-file "~/org/calendar.org")
(unless (boundp 'org-capture-templates) (unless (boundp 'org-capture-templates)
(defvar org-capture-templates nil)) (defvar org-capture-templates nil))