(ntlm-build-auth-response): Use it.
Remove Emacs 20 stuff:
* dgnushack.el (dgnushack-compile): Don't modify max-specpdl-size.
(butlast, mapc, remove): Remove the compiler macros.
* gnus-msg.el (gnus-summary-news-other-window): Use remove instead of delq
and copy-sequence.
* gnus-art.el (popup-menu): Remove the compiler macro.
* nnmail.el (nnmail-split-fancy): Don't support customizing with Emacs 20.
+2004-01-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * ntlm.el (ntlm-string-as-unibyte): New macro.
+ (ntlm-build-auth-response): Use it.
+
+ Remove Emacs 20 stuff:
+ * dgnushack.el (dgnushack-compile): Don't modify max-specpdl-size.
+ (butlast, mapc, remove): Remove the compiler macros.
+ * gnus-msg.el (gnus-summary-news-other-window): Use remove instead
+ of delq and copy-sequence.
+ * gnus-art.el (popup-menu): Remove the compiler macro.
+ * nnmail.el (nnmail-split-fancy): Don't support customizing with
+ Emacs 20.
+
2004-01-05 Simon Josefsson <jas@extundo.com>
* ntlm.el: Fix namespace. Change smb-passwd-hash into
;(push "/usr/share/emacs/site-lisp" load-path)
-;; Define compiler macros for the functions provided by cl in old Emacsen.
-(unless (featurep 'xemacs)
- (define-compiler-macro butlast (&whole form x &optional n)
- (if (>= emacs-major-version 21)
- form
- (if n
- `(let ((x ,x)
- (n ,n))
- (if (and n (<= n 0))
- x
- (let ((m (length x)))
- (or n (setq n 1))
- (and (< n m)
- (progn
- (if (> n 0)
- (progn
- (setq x (copy-sequence x))
- (setcdr (nthcdr (- (1- m) n) x) nil)))
- x)))))
- `(let* ((x ,x)
- (m (length x)))
- (and (< 1 m)
- (progn
- (setq x (copy-sequence x))
- (setcdr (nthcdr (- m 2) x) nil)
- x))))))
-
- (define-compiler-macro remove (&whole form item seq)
- (if (>= emacs-major-version 21)
- form
- `(delete ,item (copy-sequence ,seq))))
-
- (define-compiler-macro mapc (&whole form fn seq &rest rest)
- (if (>= emacs-major-version 21)
- form
- (if rest
- `(let* ((fn ,fn)
- (seq ,seq)
- (args (list seq ,@rest))
- (m (apply (function min) (mapcar (function length) args)))
- (n 0))
- (while (< n m)
- (apply fn (mapcar (function (lambda (arg) (nth n arg))) args))
- (setq n (1+ n)))
- seq)
- `(let ((seq ,seq))
- (mapcar ,fn seq)
- seq)))))
-
;; If we are building w3 in a different directory than the source
;; directory, we must read *.el from source directory and write *.elc
;; into the building directory. For that, we define this function
(defun dgnushack-compile (&optional warn)
;;(setq byte-compile-dynamic t)
- (when (and (not (featurep 'xemacs))
- (< emacs-major-version 21))
- (setq max-specpdl-size 1200))
(unless warn
(setq byte-compile-warnings
'(free-vars unresolved callargs redefine)))
(vector (caddr c) (car c) :enable t))
gnus-mime-button-commands)))
-(eval-when-compile
- (define-compiler-macro popup-menu (&whole form
- menu &optional position prefix)
- (if (and (fboundp 'popup-menu)
- (not (memq 'popup-menu (assoc "lmenu" load-history))))
- form
- ;; Gnus is probably running under Emacs 20.
- `(let* ((menu (cdr ,menu))
- (response (x-popup-menu
- t (list (car menu)
- (cons "" (mapcar (lambda (c)
- (cons (caddr c) (car c)))
- (cdr menu)))))))
- (if response
- (call-interactively (nth 3 (assq response menu))))))))
-
(defun gnus-mime-button-menu (event prefix)
"Construct a context-sensitive menu of MIME commands."
(interactive "e\nP")
(progn
(message-news (gnus-group-real-name gnus-newsgroup-name))
(set (make-local-variable 'gnus-discouraged-post-methods)
- (delq
+ (remove
(car (gnus-find-method-for-group gnus-newsgroup-name))
- (copy-sequence gnus-discouraged-post-methods))))))
+ gnus-discouraged-post-methods)))))
(save-excursion
(set-buffer buffer)
(setq gnus-newsgroup-name group)))))
(const :format "" &)
(editable-list :inline t nnmail-split-fancy))
(list :tag "Function with fixed arguments (:)"
- :value (: nil)
+ :value (:)
(const :format "" :value :)
function
(editable-list :inline t (sexp :tag "Arg"))
)
(list :tag "Function with split arguments (!)"
- :value (! nil)
+ :value (!)
(const :format "" !)
function
(editable-list :inline t nnmail-split-fancy))
domain ;bufer field
)))
+(eval-when-compile
+ (defmacro ntlm-string-as-unibyte (string)
+ (if (fboundp 'string-as-unibyte)
+ `(string-as-unibyte ,string)
+ string)))
+
(defun ntlm-build-auth-response (challenge user password-hashes)
"Return the response string to a challenge string CHALLENGE given by
the NTLM based server for the user USER and the password hash list
PASSWORD-HASHES. NTLM uses two hash values which are represented
by PASSWORD-HASHES. PASSWORD-HASHES should be a return value of
(list (ntlm-smb-passwd-hash password) (ntlm-md4hash password))"
- (let* ((rchallenge (string-as-unibyte challenge))
+ (let* ((rchallenge (ntlm-string-as-unibyte challenge))
;; get fields within challenge struct
;;(ident (substring rchallenge 0 8)) ;ident, 8 bytes
;;(msgType (substring rchallenge 8 12)) ;msgType, 4 bytes