Changeset - dedff6f56350
[Not reviewed]
0 4 0
Sergey Pashinin - 12 years ago 2014-02-26 00:10:50
sergey@pashinin.com
Use cl-flet instead of dflet
4 files changed with 19 insertions and 19 deletions:
0 comments (0 inline, 0 general)
src/workgroups-functions.el
Show inline comments
 
@@ -269,7 +269,7 @@ If BUFOBJ is a buffer or a buffer name, see `wg-buffer-uid-or-add'."
 
(defun wg-window-tree-to-wtree (window-tree)
 
  "Return the serialization (a wg-wtree) of Emacs window tree WINDOW-TREE."
 
  (wg-barf-on-active-minibuffer)
 
  (dflet
 
  (cl-flet
 
      ((inner (w) (if (windowp w) (wg-window-to-win w)
 
                    (wg-dbind (dir edges . wins) w
 
                      (wg-make-wtree
 
@@ -431,7 +431,7 @@ BUFFER or `wg-default-buffer' is visible in the only window."
 

	
 
(defun wg-scale-w-size (w width-scale height-scale)
 
  "Scale W's size by WIDTH-SCALE and HEIGHT-SCALE."
 
  (dflet
 
  (cl-flet
 
      ((wscale (width)  (truncate (* width  width-scale)))
 
       (hscale (height) (truncate (* height height-scale))))
 
    (wg-adjust-w-size w #'wscale #'hscale)))
 
@@ -460,7 +460,7 @@ new wlist, return it instead of a new wtree."
 
               (max (- hb1 1 min-size))
 
               (lastw (wg-last1 wlist)))
 
          ;;(wg--with-temporary-redefinitions
 
          (dflet
 
          (cl-flet
 
              ((mapwl
 
                (wl)
 
                (wg-dbind (sw . rest) wl
 
@@ -517,7 +517,7 @@ with `wg-scale-wconfigs-wtree' to fit the frame as it exists."
 
If DIR is nil, reverse WTREE horizontally.
 
If DIR is 'both, reverse WTREE both horizontally and vertically.
 
Otherwise, reverse WTREE vertically."
 
  (dflet
 
  (cl-flet
 
      ((inner (w) (if (wg-win-p w) w
 
                    (wg-with-slots w ((d1 wg-wtree-dir))
 
                      (wg-make-wtree
 
@@ -531,7 +531,7 @@ Otherwise, reverse WTREE vertically."
 

	
 
(defun wg-wtree-move-window (wtree offset)
 
  "Offset `selected-window' OFFSET places in WTREE."
 
  (dflet
 
  (cl-flet
 
      ((inner (w) (if (wg-win-p w) w
 
                    (wg-with-slots w ((wlist wg-wtree-wlist))
 
                      (wg-make-wtree
 
@@ -556,7 +556,7 @@ Otherwise, reverse WTREE vertically."
 
  "Return a new list by flattening WTREE.
 
KEY non returns returns a list of WTREE's wins.
 
KEY non-nil returns a list of the results of calling KEY on each win."
 
  (dflet
 
  (cl-flet
 
      ((inner (w) (if (wg-win-p w) (list (if key (funcall key w) w))
 
                    (cl-mapcan 'inner (wg-wtree-wlist w)))))
 
    (inner wtree)))
src/workgroups-pickel.el
Show inline comments
 
@@ -137,7 +137,7 @@
 
  "Return a table binding unique subobjects of OBJ to ids."
 
  (let ((binds (make-hash-table :test 'eq))
 
        (id -1))
 
    (dflet
 
    (cl-flet
 
     ((inner (obj)
 
           (unless (gethash obj binds)
 
              (puthash obj (cl-incf id) binds)
src/workgroups-specialbufs.el
Show inline comments
 
@@ -113,8 +113,8 @@ You can get these commands using `wg-get-org-agenda-view-commands'."
 
                                  (wg-last1 (process-command (get-buffer-process buffer)))
 
                                "/bin/bash")))
 
              (deserialize . ,(lambda (buffer vars)
 
                                (dflet ((term-window-width () 80)
 
                                        (window-height () 24))
 
                                (cl-flet ((term-window-width () 80)
 
                                          (window-height () 24))
 
                                  (prog1 (term vars)
 
                                    (rename-buffer (wg-buf-name buffer) t)))))))
 

	
src/workgroups-utils-basic.el
Show inline comments
 
@@ -222,8 +222,8 @@ Cribbed from `org-id-b36-to-int-one-digit'."
 
(defun wg-int-to-b36 (i &optional length)
 
  "Return a base 36 string from I."
 
  (let ((base 36) b36)
 
    (dflet ((add-digit () (push (wg-int-to-b36-one-digit (mod i base)) b36)
 
                      (setq i (/ i base))))
 
    (cl-flet ((add-digit () (push (wg-int-to-b36-one-digit (mod i base)) b36)
 
                         (setq i (/ i base))))
 
      (add-digit)
 
      (while (> i 0) (add-digit))
 
      (setq b36 (cl-map 'string 'identity b36))
 
@@ -514,11 +514,11 @@ options."
 
  (declare (indent 2))
 
  (let* ((name (if (consp name-form) (car name-form) name-form))
 
         (prefixed-name (wg-symcat prefix "-" name)))
 
    (dflet ((rebind (opstr)
 
                   (let ((oldfnsym (wg-symcat opstr "-" prefix "-" name)))
 
                     `((fset ',(wg-symcat prefix "-" opstr "-" name)
 
                             (symbol-function ',oldfnsym))
 
                       (fmakunbound ',oldfnsym)))))
 
    (cl-flet ((rebind (opstr)
 
                      (let ((oldfnsym (wg-symcat opstr "-" prefix "-" name)))
 
                        `((fset ',(wg-symcat prefix "-" opstr "-" name)
 
                                (symbol-function ',oldfnsym))
 
                          (fmakunbound ',oldfnsym)))))
 
      ;; `eval-and-compile' gets rid of byte-comp warnings ("function `foo' not
 
      ;; known to be defined").  We can accomplish this with `declare-function'
 
      ;; too, but it annoyingly requires inclusion of the function's arglist,
 
@@ -572,9 +572,9 @@ the cadr as the accessor function."
 
                              read hist default-value inherit-input-method)
 
  "PROMPT for an object that satisfies TEST, WARNING if necessary.
 
ARGS are `read-from-minibuffer's args, after PROMPT."
 
  (dflet ((read () (read-from-minibuffer
 
                    prompt initial-contents keymap read hist
 
                    default-value inherit-input-method)))
 
  (cl-flet ((read () (read-from-minibuffer
 
                      prompt initial-contents keymap read hist
 
                      default-value inherit-input-method)))
 
    (let ((obj (read)))
 
      (when (and (equal obj "") default-value) (setq obj default-value))
 
      (while (not (funcall test obj))
0 comments (0 inline, 0 general)