Skip to content

Commit

Permalink
A non-working Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Patil <[email protected]>
  • Loading branch information
Sachin Patil committed Apr 16, 2016
1 parent 7d449bb commit 5d75a09
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 41 deletions.
63 changes: 63 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
EMACS=emacs

EMACS_CLEAN=-Q
EMACS_BATCH=$(EMACS_CLEAN) --batch
TESTS=

CURL=curl --silent
WORK_DIR=$(shell pwd)
PACKAGE_NAME=$(shell basename $(WORK_DIR))
AUTOLOADS_FILE=$(PACKAGE_NAME)-autoloads.el
TRAVIS_FILE=.travis.yml
TEST_DIR=ert-tests
TEST_DEP_1=ert
TEST_DEP_1_STABLE_URL=http://git.savannah.gnu.org/cgit/emacs.git/plain/lisp/emacs-lisp/ert.el?h=emacs-24.3
TEST_DEP_1_LATEST_URL=http://git.savannah.gnu.org/cgit/emacs.git/plain/lisp/emacs-lisp/ert.el?h=master

.PHONY : build downloads downloads-latest autoloads test-autoloads test-travis \
test test-interactive clean edit test-dep-1 test-dep-2 test-dep-3 \
test-dep-4 test-dep-5 test-dep-6 test-dep-7 test-dep-8 test-dep-9

build :
$(EMACS) $(EMACS_BATCH) --eval \
"(progn \
(setq byte-compile-error-on-warn t) \
(batch-byte-compile))" *.el

test-dep-1 :
@cd $(TEST_DIR) && \
$(EMACS) $(EMACS_BATCH) -L . -L .. -l $(TEST_DEP_1) || \
(echo "Can't load test dependency $(TEST_DEP_1).el, run 'make downloads' to fetch it" ; exit 1)

downloads :
$(CURL) '$(TEST_DEP_1_STABLE_URL)' > $(TEST_DIR)/$(TEST_DEP_1).el

downloads-latest :
$(CURL) '$(TEST_DEP_1_LATEST_URL)' > $(TEST_DIR)/$(TEST_DEP_1).el

autoloads :
$(EMACS) $(EMACS_BATCH) --eval \
"(progn \
(setq generated-autoload-file \"$(WORK_DIR)/$(AUTOLOADS_FILE)\") \
(update-directory-autoloads \"$(WORK_DIR)\"))"

test-autoloads : autoloads
@$(EMACS) $(EMACS_BATCH) -L . -l "./$(AUTOLOADS_FILE)" || \
( echo "failed to load autoloads: $(AUTOLOADS_FILE)" && false )

test-travis :
@if test -z "$$TRAVIS" && test -e $(TRAVIS_FILE); then travis-lint $(TRAVIS_FILE); fi

test : build test-dep-1 test-autoloads
@cd $(TEST_DIR) && \
(for test_lib in *-test.el; do \
$(EMACS) $(EMACS_BATCH) -L . -L .. -l cl -l $(TEST_DEP_1) -l $$test_lib --eval \
"(flet ((ert--print-backtrace (&rest args) \
(insert \"no backtrace in batch mode\"))) \
(ert-run-tests-batch-and-exit '(and \"$(TESTS)\" (not (tag :interactive)))))" || exit 1; \
done)

clean :
@rm -f $(AUTOLOADS_FILE) *.elc *~ */*.elc */*~
@rm -f \#*\#

35 changes: 18 additions & 17 deletions general_config.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

;; show matching parenthesis
(show-paren-mode t)
(setq show-paren-style 'parenthesis) ; highlight just brackets
(setq-default show-paren-style 'parenthesis) ; highlight just brackets
;; (setq show-paren-style 'expression) ; highlight entire bracket expression

;; hide tool-bar and menubar
Expand Down Expand Up @@ -152,8 +152,8 @@
'("\\.h\\'" . c++-mode))

;; Enable Allman Style of indentation for C code. OpenSource for you, Jan 2014.
(setq c-default-style "linux"
c-basic-offset 4)
(setq-default c-default-style "linux"
c-basic-offset 4)

;; Save all backup files in pne space
(setq backup-directory-alist '(("." . "/home/sachin/.emacs-saves")))
Expand Down Expand Up @@ -238,15 +238,16 @@
(global-set-key (kbd "C-x p") 'goto-percent)

;; Add workflow state in org-mode
(setq org-todo-keywords
'((sequence "TODO" "IN-PROGRESS" "WAITING" "DONE")))
(setq-default org-todo-keywords
'((sequence "TODO" "FIXME" "IN-PROGRESS" "WAITING" "DONE")))

;; This will create a date-time stamp for tasks marked as 'DONE'.
(setq org-log-done t)
(setq-default org-log-done t)

;; My org-agenda
(setq org-agenda-files (let (list)
(add-to-list 'list "/home/sachin/org/")))
;; FIXME: User directory should not be hard-coded
(setq-default org-agenda-files (let (list)
(add-to-list 'list "/home/psachin/org/")))

;; Highlight Comment Annotations
(defun font-lock-comment-annotations ()
Expand All @@ -271,7 +272,7 @@ programming."
"Open Emacs init file."
(interactive)
(find-file-other-window (substring
user-init-file)))
user-init-file nil)))
(global-set-key (kbd "C-c h") 'open-emacs-init)

;;; edit root file [emacsredux.com]
Expand Down Expand Up @@ -330,11 +331,11 @@ buffer is not visiting a file."
;; ))

;; Source: http://blog.paphus.com/blog/2012/08/01/introducing-octopress-blogging-for-org-mode/
(defun save-then-publish ()
(interactive)
(save-buffer)
(org-save-all-org-buffers)
(org-publish-current-project))
;; (defun save-then-publish ()
;; (interactive)
;; (save-buffer)
;; (org-save-all-org-buffers)
;; (org-publish-current-project))

;; (add-to-list 'load-path "/home/sachin/github/orgmode-octopress/")
;; (require 'org-octopress)
Expand All @@ -357,9 +358,9 @@ a query prompt otherwise."

(defun sort-buffers ()
"Put the buffer list in alphabetical order."
(interactive)
(called-interactively-p 'interactive)
(dolist (buff (buffer-list-sorted)) (bury-buffer buff))
(when (interactive-p) (list-buffers)))
(when (called-interactively-p 'any) (list-buffers)))
;;(global-set-key "\M-b" 'sort-buffers)

(defun buffer-list-sorted ()
Expand Down Expand Up @@ -395,7 +396,7 @@ Enter custom-name or RET to save image with timestamp"
(defun surround(tag)
"Surround word within TAG.
TAG can be <>," ",' ',[ ], etc."
(interactive "sWord should be inside: ")
(called-interactively-p "sWord should be inside: ")
(backward-word)
(mark-word)
(when (region-active-p)
Expand Down
26 changes: 13 additions & 13 deletions gnus.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

;; --------------------------------------------------
;; for GMail
(setq gnus-select-method
'(nnimap "gmail"
(nnimap-address "imap.gmail.com")
(nnimap-server-port 993)
(nnimap-stream ssl)))
(setq-default gnus-select-method
'(nnimap "gmail"
(nnimap-address "imap.gmail.com")
(nnimap-server-port 993)
(nnimap-stream ssl)))

;; original-port: 587
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
smtpmail-auth-credentials '(("smtp.gmail.com" 587
"[email protected]" nil))
smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-smtp-service 587
gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")
(setq-default message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
smtpmail-auth-credentials '(("smtp.gmail.com" 587
"[email protected]" nil))
smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-smtp-service 587
gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")
;; --------------------------------------------------
20 changes: 9 additions & 11 deletions package_init.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
(ac-ispell-setup)))

(yas-global-mode t)
(setq yas-snippet-dirs "~/.emacs.d/snippets/")
(setq-default yas-snippet-dirs "~/.emacs.d/snippets/")

;; hidepw
(add-to-list 'load-path "~/.emacs.d/extensions/hidepw/")
(require 'hidepw)

(add-to-list 'auto-mode-alist
'("\\.gpg\\'" . (lambda () (hidepw-mode))))
Expand All @@ -33,18 +32,17 @@
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))


(setq org-latex-listings 'minted)

(setq org-export-latex-custom-lang-environments
'(
(emacs-lisp "common-lispcode")
))
(setq-default org-export-latex-custom-lang-environments
'(
(emacs-lisp "common-lispcode")
))

(setq org-export-latex-minted-options
'(("frame" "lines")
("fontsize" "\\scriptsize")
("linenos" "")))
(setq-default org-export-latex-minted-options
'(("frame" "lines")
("fontsize" "\\scriptsize")
("linenos" "")))

(setq org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
Expand Down

0 comments on commit 5d75a09

Please sign in to comment.