summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-04-20 01:47:56 +0200
committerGravatar Tom Willemse2014-04-20 01:47:56 +0200
commitc10d653b43b37e4af98c0c12d4c2abbd85834315 (patch)
tree7f4b5bc847c9ee86dd2ea2418c2d23369be55f30
parent80f1a48561a0a722ce23580d4d3084acbca4c828 (diff)
downloademacs-c10d653b43b37e4af98c0c12d4c2abbd85834315.tar.gz
emacs-c10d653b43b37e4af98c0c12d4c2abbd85834315.zip
Fix some compiler warnings
-rw-r--r--.emacs.d/init.org42
1 files changed, 42 insertions, 0 deletions
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