From eabde20f72f9fa86dee2a2f4271c81ee0a981509 Mon Sep 17 00:00:00 2001 From: cngimenez Date: Sat, 21 May 2022 13:39:53 -0300 Subject: Moving variables to the top to fix byte-compile warnings. Fixing "reference to free variable" warnings on some variables. --- jabber.el | 44 +++++++++++++------------- jabber.org | 104 ++++++++++++++++++++++++++++++++++--------------------------- 2 files changed, 80 insertions(+), 68 deletions(-) diff --git a/jabber.el b/jabber.el index 95138bc..6647a6b 100644 --- a/jabber.el +++ b/jabber.el @@ -68,9 +68,29 @@ Consider adding the file-local variable prop-line to the tangled jabber.el file or try to byte-compile the code.")) ;; lexical binding test:1 ends here -;; [[file:jabber.org::#custom-variables][custom variables:1]] +;; [[file:jabber.org::#custom-variables][jabber-enable-legacy-features-p:1]] (defvar jabber-enable-legacy-features-p nil) -;; custom variables:1 ends here +;; jabber-enable-legacy-features-p:1 ends here + +;; [[file:jabber.org::#process-buffer][jabber-process-buffer:1]] +(defvar jabber-process-buffer " *-jabber-process-*" + "The name of the process buffer.") +;; jabber-process-buffer:1 ends here + +;; [[file:jabber.org::#debug-keep-process-buffers][jabber-debug-keep-process-buffers:1]] +(defcustom jabber-debug-keep-process-buffers nil + "If nil, kill process buffers when the process dies. +Contents of process buffers might be useful for debugging." + :type 'boolean + :group 'jabber-debug) +;; jabber-debug-keep-process-buffers:1 ends here + +;; [[file:jabber.org::#silent-mode][jabber-silent-mode:1]] +(defcustom jabber-silent-mode nil + "If non-nil, do not ask for confirmation for some operations. DANGEROUS!" + :type 'boolean + :group 'jabber) +;; jabber-silent-mode:1 ends here ;; [[file:jabber.org::#xml-functions][XML functions:1]] (require 'xml) @@ -2310,11 +2330,6 @@ indefinitely. See `password-cache' and `password-cache-expiry'." :group 'jabber-core) ;; jabber-roster-buffer:1 ends here -;; [[file:jabber.org::#process-buffer][jabber-process-buffer:1]] -(defvar jabber-process-buffer " *-jabber-process-*" - "The name of the process buffer.") -;; jabber-process-buffer:1 ends here - ;; [[file:jabber.org::#use-sasl][jabber-use-sasl:1]] (defcustom jabber-use-sasl t "If non-nil, use SASL if possible. @@ -14298,21 +14313,6 @@ configure a Google Talk account like this: :group 'jabber) ;; jabber-debug:1 ends here -;; [[file:jabber.org::#debug-keep-process-buffers][jabber-debug-keep-process-buffers:1]] -(defcustom jabber-debug-keep-process-buffers nil - "If nil, kill process buffers when the process dies. -Contents of process buffers might be useful for debugging." - :type 'boolean - :group 'jabber-debug) -;; jabber-debug-keep-process-buffers:1 ends here - -;; [[file:jabber.org::#silent-mode][jabber-silent-mode:1]] -(defcustom jabber-silent-mode nil - "If non-nil, do not ask for confirmation for some operations. DANGEROUS!" - :type 'boolean - :group 'jabber) -;; jabber-silent-mode:1 ends here - ;; [[file:jabber.org::#presence-faces][jabber-presence-faces:1]] ;;;###autoload (defconst jabber-presence-faces diff --git a/jabber.org b/jabber.org index b41feb8..658cd1f 100644 --- a/jabber.org +++ b/jabber.org @@ -102,7 +102,13 @@ Consider adding the file-local variable prop-line to the tangled jabber.el file or try to byte-compile the code.")) #+END_SRC -** custom variables +** Shared variables +These are variables shared with more than one section. For instance, =jabber-process-buffer= is used at the Section [[#core][core]] but also at Section [[#network-transport-functions][Network transport functions]]. + +Placing these variables definitions before using them avoid byte-compile warnings. Moreover, it is common practice to define variables before its usage. + +*** Custom variables +**** jabber-enable-legacy-features-p :variable: :PROPERTIES: :CUSTOM_ID: custom-variables :END: @@ -110,6 +116,44 @@ or try to byte-compile the code.")) (defvar jabber-enable-legacy-features-p nil) #+END_SRC +*** Core +These variables were originally defined at Section [[#core][core]]. + +**** jabber-process-buffer :variable: +:PROPERTIES: +:CUSTOM_ID: process-buffer +:END: +#+BEGIN_SRC emacs-lisp +(defvar jabber-process-buffer " *-jabber-process-*" + "The name of the process buffer.") +#+END_SRC + +*** Jabber +These variables were originally defined at Section [[#jabber][Jabber]]. +**** jabber-debug-keep-process-buffers :custom:variable: +:PROPERTIES: +:CUSTOM_ID: debug-keep-process-buffers +:END: +#+BEGIN_SRC emacs-lisp +(defcustom jabber-debug-keep-process-buffers nil + "If nil, kill process buffers when the process dies. +Contents of process buffers might be useful for debugging." + :type 'boolean + :group 'jabber-debug) +#+END_SRC + +**** jabber-silent-mode :custom:variable: +:PROPERTIES: +:CUSTOM_ID: silent-mode +:END: +#+BEGIN_SRC emacs-lisp +(defcustom jabber-silent-mode nil + "If non-nil, do not ask for confirmation for some operations. DANGEROUS!" + :type 'boolean + :group 'jabber) +#+END_SRC + + ** XML functions :PROPERTIES: :old-file: jabber-xml.el @@ -505,7 +549,7 @@ specially." (defalias 'jabber-propertize 'propertize) #+END_SRC -*** bound-and-true-p :macro: +*** bound-and-true-p :macro: :PROPERTIES: :CUSTOM_ID: bound-true-p :END: @@ -2986,15 +3030,6 @@ indefinitely. See `password-cache' and `password-cache-expiry'." :group 'jabber-core) #+END_SRC -*** jabber-process-buffer :variable: -:PROPERTIES: -:CUSTOM_ID: process-buffer -:END: -#+BEGIN_SRC emacs-lisp -(defvar jabber-process-buffer " *-jabber-process-*" - "The name of the process buffer.") -#+END_SRC - *** jabber-use-sasl :custom:variable: :PROPERTIES: :CUSTOM_ID: use-sasl @@ -3169,7 +3204,7 @@ With double prefix argument, specify more connection details." jabber-connections))) #+END_SRC -*** jabber-connection :fsm: +*** jabber-connection :fsm: :PROPERTIES: :CUSTOM_ID: fsm-connection :END: @@ -3197,7 +3232,7 @@ With double prefix argument, specify more connection details." :port port))))) #+END_SRC -**** nil :fsm:state: +**** nil :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-nil :END: @@ -3261,7 +3296,7 @@ With double prefix argument, specify more connection details." (list nil state-data nil)))) #+END_SRC -**** connecting :fsm:state: +**** connecting :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-connecting :END: @@ -3309,7 +3344,7 @@ With double prefix argument, specify more connection details." :defer))) #+END_SRC -**** jabber-fsm-handle-sentinel :inline:function: +**** jabber-fsm-handle-sentinel :inline:function: :PROPERTIES: :CUSTOM_ID: fsm-handle-sentinel :END: @@ -3333,7 +3368,7 @@ With double prefix argument, specify more connection details." (list nil new-state-data))) #+END_SRC -**** connected :fsm:state: +**** connected :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-connected :END: @@ -3412,7 +3447,7 @@ With double prefix argument, specify more connection details." :disconnection-expected t))))) #+END_SRC -**** starttls :fsm:state: +**** starttls :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-starttls :END: @@ -3454,7 +3489,7 @@ With double prefix argument, specify more connection details." :disconnection-expected t))))) #+END_SRC -**** register-account :fsm:state: +**** register-account :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-register-account :END: @@ -3492,7 +3527,7 @@ With double prefix argument, specify more connection details." :disconnection-expected t))))) #+END_SRC -**** legacy-auth :fsm:state: +**** legacy-auth :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-legacy-auth :END: @@ -3540,7 +3575,7 @@ With double prefix argument, specify more connection details." :disconnection-expected t))))) #+END_SRC -**** sasl-auth :fsm:state: +**** sasl-auth :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-sasl-auth :END: @@ -3596,7 +3631,7 @@ With double prefix argument, specify more connection details." :disconnection-expected t))))) #+END_SRC -**** bind :fsm:state: +**** bind :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-bind :END: @@ -3701,7 +3736,7 @@ With double prefix argument, specify more connection details." :disconnection-expected t))))) #+END_SRC -**** jabber-pending-presence-timeout :variable: +**** jabber-pending-presence-timeout :variable: :PROPERTIES: :CUSTOM_ID: pending-presence-timeout :END: @@ -3710,7 +3745,7 @@ With double prefix argument, specify more connection details." "Wait this long before doing presence packet batch processing.") #+END_SRC -**** session-established :fsm:state: +**** session-established :fsm:state: :PROPERTIES: :CUSTOM_ID: fsm-state-session-established :END: @@ -18008,29 +18043,6 @@ configure a Google Talk account like this: :group 'jabber) #+END_SRC -*** jabber-debug-keep-process-buffers :custom:variable: -:PROPERTIES: -:CUSTOM_ID: debug-keep-process-buffers -:END: -#+BEGIN_SRC emacs-lisp -(defcustom jabber-debug-keep-process-buffers nil - "If nil, kill process buffers when the process dies. -Contents of process buffers might be useful for debugging." - :type 'boolean - :group 'jabber-debug) -#+END_SRC - -*** jabber-silent-mode :custom:variable: -:PROPERTIES: -:CUSTOM_ID: silent-mode -:END: -#+BEGIN_SRC emacs-lisp -(defcustom jabber-silent-mode nil - "If non-nil, do not ask for confirmation for some operations. DANGEROUS!" - :type 'boolean - :group 'jabber) -#+END_SRC - *** jabber-presence-faces :constant: :PROPERTIES: :CUSTOM_ID: presence-faces -- cgit v1.2.3