From c10d653b43b37e4af98c0c12d4c2abbd85834315 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 20 Apr 2014 01:47:56 +0200 Subject: Fix some compiler warnings --- .emacs.d/init.org | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to '.emacs.d') diff --git a/.emacs.d/init.org b/.emacs.d/init.org index 80007b3..c980f38 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -238,7 +238,13 @@ it was easy to modify the source code posted there to come up with this. + *Note:* See my [[Function declarations][note]] on function declarations about the use of + =declare-function=. + #+BEGIN_SRC emacs-lisp + (declare-function message-narrow-to-headers-or-head "message") + (declare-function message-fetch-field "message") + (defun oni:switch-ispell-dictionary () (save-excursion (message-narrow-to-headers-or-head) @@ -261,7 +267,12 @@ very nice compared to shr. So just remove its ability to add background colors. + *Note:* See my [[Function declarations][note]] on function declarations about the use of + =declare-function=. + #+BEGIN_SRC emacs-lisp + (declare-function shr-colorize-region "shr") + (defun oni:shr-colorize-remove-last-arg (args) "If ARGS has more than 3 items, remove the last one." (if (> (length args) 3) @@ -312,7 +323,10 @@ Don't load all buffers right away. Having a lot of buffers and switching between projects a lot can take up quite a bit of time. + *Note:* See my [[Vacuous defvar][note]] on vacuous defvar for this use of =defvar=. + #+BEGIN_SRC emacs-lisp + (defvar desktop-restore-eager) (setq desktop-restore-eager 5) #+END_SRC @@ -323,7 +337,15 @@ you see one thing and another is sent. Passing the correct keys directly to the terminal fixes this problem. + *Note:* See my [[Vacuous defvar][note]] on vacuous defvar for this use of =defvar=. + + *Note:* See my [[Function declarations][note]] on function declarations about the use of + =declare-function=. + #+BEGIN_SRC emacs-lisp + (defvar term-raw-map) + (declare-function term-send-raw-string "term") + (defun oni:set-term-keys () (cl-flet ((zcommand (key) (lambda () @@ -359,6 +381,26 @@ (defalias 'dabbrev-expand 'hippie-expand) #+END_SRC +* Notes + + Here are some random or somewhat general notes about things you may + run into when looking through my Emacs init. + +** Vacuous defvar + + A =defvar= without a value like =(defvar some-variable)= tells the + byte-compiler that the variable will appear, but doesn't give it a + value. It should only count for the file where it is used and once + the file with the /actual/ =defvar= is loaded it will be populated with + its value, contrary to what would happen if you'd given it a value + before loading its original file. + +** Function declarations + + The function =declare-function= tells the byte-compiler where to find + a certain function. This keeps the byte-compiler from complaining + about certain functions possibly not being defined at run-time. + * Footnotes [fn:1] This runs =tmm-menubar=, which lets you navigate the menubar in a -- cgit v1.2.3-54-g00ecf