Commit f58e0fd5 authored by Stefan Monnier's avatar Stefan Monnier

Reduce use of (require 'cl).

* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
parent dfa96edd
2012-07-10 Stefan Monnier <monnier@iro.umontreal.ca>
* bzrmerge.el: Use cl-lib.
2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
Rename configure.in to configure.ac (Bug#11603).
......@@ -30,8 +34,8 @@
* coccinelle: New subdirectory
* coccinelle/README: Documentation stub.
* coccinelle/vector_contents.cocci: Semantic patch to replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.
2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
......@@ -50,9 +54,9 @@
2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
* make-emacs: Rename --union-type to --check-lisp-type. Define
CHECK_LISP_OBJECT_TYPE insted of USE_LISP_UNION_TYPE.
* CPP-DEFINES (DEBUG_LISP_OBJECT_TYPE): Renamed from
* make-emacs: Rename --union-type to --check-lisp-type.
Define CHECK_LISP_OBJECT_TYPE insted of USE_LISP_UNION_TYPE.
* CPP-DEFINES (DEBUG_LISP_OBJECT_TYPE): Rename from
USE_LISP_UNION_TYPE.
2012-06-03 Glenn Morris <rgm@gnu.org>
......@@ -223,11 +227,11 @@
* unidata/makefile.w32-in (all): Remove src/biditype.h and
src/bidimirror.h.
(../../src/biditype.h, ../../src/bidimirror.h): Deleted.
(../../src/biditype.h, ../../src/bidimirror.h): Delete.
* unidata/Makefile.in (all): Remove src/biditype.h and
src/bidimirror.h.
(../../src/biditype.h, ../../src/bidimirror.h): Deleted.
(../../src/biditype.h, ../../src/bidimirror.h): Delete.
2011-07-07 Juanma Barranquero <lekktu@gmail.com>
......@@ -238,8 +242,8 @@
* unidata/unidata-gen.el (unidata-dir): New variable.
(unidata-setup-list): Expand unidata-text-file in unidata-dir.
(unidata-prop-alist): INDEX element may be a function. New
optional element VAL-LIST (for general-category and bidi-class).
(unidata-prop-alist): INDEX element may be a function.
New optional element VAL-LIST (for general-category and bidi-class).
New entry `mirroring'.
(unidata-prop-default, unidata-prop-val-list): New subst.
(unidata-get-character, unidata-put-character): Delete them.
......@@ -595,13 +599,13 @@
2009-04-17 Kenichi Handa <handa@m17n.org>
* unidata/unidata-gen.el (unidata-get-decomposition): Adjust
Hangle decomposition rule to Unicode.
* unidata/unidata-gen.el (unidata-get-decomposition):
Adjust Hangle decomposition rule to Unicode.
2009-04-09 Kenichi Handa <handa@m17n.org>
* unidata/unidata-gen.el (unidata-describe-decomposition): Return
a string with a composition property to disable combining
* unidata/unidata-gen.el (unidata-describe-decomposition):
Return a string with a composition property to disable combining
characters being composed.
2009-03-11 Miles Bader <miles@gnu.org>
......@@ -1096,7 +1100,7 @@
2005-10-17 Bill Wohler <wohler@newt.com>
* FOR-RELEASE (DOCUMENTATION): Removed lisp/toolbar from list
* FOR-RELEASE (DOCUMENTATION): Remove lisp/toolbar from list
since it's gone. Also marked mh-e as done.
2005-10-11 Juanma Barranquero <lekktu@gmail.com>
......@@ -1143,7 +1147,7 @@
2005-03-30 Marcelo Toledo <marcelo@marcelotoledo.org>
* FOR-RELEASE (Documentation): Added check the Emacs Tutorial.
* FOR-RELEASE (Documentation): Add check the Emacs Tutorial.
The first line of every tutorial must begin with a sentence saying
"Emacs Tutorial" in the respective language. This should be
followed by "See end for copying conditions", likewise in the
......
......@@ -24,8 +24,7 @@
;;; Code:
(eval-when-compile
(require 'cl)) ; assert
(eval-when-compile (require 'cl-lib))
(defvar bzrmerge-skip-regexp
"back[- ]?port\\|merge\\|sync\\|re-?generate\\|bump version\\|from trunk\\|\
......@@ -256,17 +255,17 @@ Does not make other difference."
;; Do a "skip" (i.e. merge the meta-data only).
(setq beg (1- (car skip)))
(while (and skip (or (null merge) (< (car skip) (car merge))))
(assert (> (car skip) (or end beg)))
(cl-assert (> (car skip) (or end beg)))
(setq end (pop skip)))
(message "Skipping %s..%s" beg end)
(bzrmerge-add-metadata from end))
(t
;; Do a "normal" merge.
(assert (or (null skip) (< (car merge) (car skip))))
(cl-assert (or (null skip) (< (car merge) (car skip))))
(setq beg (1- (car merge)))
(while (and merge (or (null skip) (< (car merge) (car skip))))
(assert (> (car merge) (or end beg)))
(cl-assert (> (car merge) (or end beg)))
(setq end (pop merge)))
(message "Merging %s..%s" beg end)
(if (with-temp-buffer
......
2012-07-10 Stefan Monnier <monnier@iro.umontreal.ca>
* quail/ipa.el: Use cl-lib.
* quail/hangul.el: Don't require CL.
2012-06-12 Nguyen Thai Ngoc Duy <pclouds@gmail.com>
* quail/vnvi.el: New file (Bug#4747).
......
......@@ -30,7 +30,6 @@
;;; Code:
(require 'quail)
(eval-when-compile (require 'cl)) ; for setf
(require 'hanja-util)
;; Hangul double Jamo table.
......
......@@ -29,7 +29,7 @@
;;; Code:
(require 'quail)
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(quail-define-package
"ipa" "IPA" "IPA" t
......@@ -277,13 +277,13 @@ string."
(setq quail-keymap (list (string quail-keymap)))
(if (stringp quail-keymap)
(setq quail-keymap (list quail-keymap))
(assert (vectorp quail-keymap) t)
(cl-assert (vectorp quail-keymap) t)
(setq quail-keymap (append quail-keymap nil))))
(list
(apply 'vector
(mapcar
#'(lambda (entry)
(assert (char-or-string-p entry) t)
(cl-assert (char-or-string-p entry) t)
(format "%s%s" to-prepend
(if (integerp entry) (string entry) entry)))
quail-keymap))))
......@@ -318,18 +318,18 @@ particular sequence of keys, and the result will be cached by Quail."
(dolist (underscoring underscore-map)
(cond ((null underscoring))
((eq (length underscoring) 2)
(setq underscore-map-entry (second underscoring))
(setq underscore-map-entry (cl-second underscoring))
(setcdr underscoring (ipa-x-sampa-prepend-to-keymap-entry
pre-underscore-map underscore-map-entry)))
((eq (length underscoring) 3)
(setq underscore-map-entry (second (third underscoring)))
(setcdr (third underscoring)
(setq underscore-map-entry (cl-second (cl-third underscoring)))
(setcdr (cl-third underscoring)
(ipa-x-sampa-prepend-to-keymap-entry
pre-underscore-map underscore-map-entry)))
(t
(assert (null t) t
"Can't handle subtrees of this level right now."))))
(append underscore-map (list (list ?< (second x-sampa-submap-entry))))))
(cl-assert (null t) t
"Can't handle subtrees of this level right now."))))
(append underscore-map (list (list ?< (cl-second x-sampa-submap-entry))))))
(quail-define-package
"ipa-x-sampa" "IPA" "IPA-X" t
......
2012-07-10 Stefan Monnier <monnier@iro.umontreal.ca>
Reduce use of (require 'cl).
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-lisp/bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-lisp/byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-lisp/autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
* emacs-lisp/gv.el (cond): Make it a valid place.
(if): Simplify slightly.
......
......@@ -31,7 +31,7 @@
;;; Code:
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(defgroup abbrev-mode nil
"Word abbreviations mode."
......@@ -540,7 +540,7 @@ the current abbrev table before abbrev lookup happens."
(dotimes (i (length table))
(aset table i 0))
;; Preserve the table's properties.
(assert sym)
(cl-assert sym)
(let ((newsym (intern "" table)))
(set newsym nil) ; Make sure it won't be confused for an abbrev.
(setplist newsym (symbol-plist sym)))
......@@ -583,8 +583,8 @@ An obsolete but still supported calling form is:
\(define-abbrev TABLE NAME EXPANSION &optional HOOK COUNT SYSTEM)."
(when (and (consp props) (or (null (car props)) (numberp (car props))))
;; Old-style calling convention.
(setq props (list* :count (car props)
(if (cadr props) (list :system (cadr props))))))
(setq props `(:count ,(car props)
,@(if (cadr props) (list :system (cadr props))))))
(unless (plist-get props :count)
(setq props (plist-put props :count 0)))
(let ((system-flag (plist-get props :system))
......@@ -621,7 +621,7 @@ current (if global is nil) or standard syntax table."
(let ((badchars ())
(pos 0))
(while (string-match "\\W" abbrev pos)
(pushnew (aref abbrev (match-beginning 0)) badchars)
(cl-pushnew (aref abbrev (match-beginning 0)) badchars)
(setq pos (1+ pos)))
(error "Some abbrev characters (%s) are not word constituents %s"
(apply 'string (nreverse badchars))
......@@ -836,8 +836,7 @@ return value is that of `abbrev-insert'.)"
(interactive)
(run-hooks 'pre-abbrev-expand-hook)
(with-wrapper-hook abbrev-expand-functions ()
(destructuring-bind (&optional sym name wordstart wordend)
(abbrev--before-point)
(pcase-let ((`(,sym ,name ,wordstart ,wordend) (abbrev--before-point)))
(when sym
(let ((startpos (copy-marker (point) t))
(endmark (copy-marker wordend t)))
......
......@@ -36,12 +36,12 @@
;; Fixed bug, current-local-map can return nil.
;; Change, doesn't calculate key-bindings unless needed.
;; Added super-apropos capability, changed print functions.
;;; Made fast-apropos and super-apropos share code.
;;; Sped up fast-apropos again.
;; Made fast-apropos and super-apropos share code.
;; Sped up fast-apropos again.
;; Added apropos-do-all option.
;;; Added fast-command-apropos.
;; Added fast-command-apropos.
;; Changed doc strings to comments for helping functions.
;;; Made doc file buffer read-only, buried it.
;; Made doc file buffer read-only, buried it.
;; Only call substitute-command-keys if do-all set.
;; Optionally use configurable faces to make the output more legible.
......@@ -57,7 +57,6 @@
;;; Code:
(require 'button)
(eval-when-compile (require 'cl))
(defgroup apropos nil
"Apropos commands for users and programmers."
......@@ -640,11 +639,11 @@ the output includes key-bindings of commands."
(setq lh (cdr lh)))))
(unless lh-entry (error "Unknown library `%s'" file)))
(dolist (x (cdr lh-entry))
(case (car-safe x)
(pcase (car-safe x)
;; (autoload (push (cdr x) autoloads))
(require (push (cdr x) requires))
(provide (push (cdr x) provides))
(t (push (or (cdr-safe x) x) symbols))))
(`require (push (cdr x) requires))
(`provide (push (cdr x) provides))
(_ (push (or (cdr-safe x) x) symbols))))
(let ((apropos-pattern "")) ;Dummy binding for apropos-symbols-internal.
(apropos-symbols-internal
symbols apropos-do-all
......
......@@ -94,9 +94,6 @@
(require 'timer)
(eval-when-compile (require 'cl))
;; Custom Group:
;;
;; The two modes will be placed next to Auto Save Mode under the
......
......@@ -67,7 +67,7 @@
;;; Code:
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(defgroup avoid nil
"Make mouse pointer stay out of the way of editing."
......@@ -206,30 +206,30 @@ If you want the mouse banished to a different corner set
(let* ((fra-or-win (assoc-default
'frame-or-window
mouse-avoidance-banish-position 'eq))
(list-values (case fra-or-win
(frame (list 0 0 (frame-width) (frame-height)))
(window (window-edges))))
(alist (loop for v in list-values
for k in '(left top right bottom)
collect (cons k v)))
(list-values (pcase fra-or-win
(`frame (list 0 0 (frame-width) (frame-height)))
(`window (window-edges))))
(alist (cl-loop for v in list-values
for k in '(left top right bottom)
collect (cons k v)))
(side (assoc-default
'side
mouse-avoidance-banish-position 'eq))
mouse-avoidance-banish-position #'eq))
(side-dist (assoc-default
'side-pos
mouse-avoidance-banish-position 'eq))
mouse-avoidance-banish-position #'eq))
(top-or-bottom (assoc-default
'top-or-bottom
mouse-avoidance-banish-position 'eq))
mouse-avoidance-banish-position #'eq))
(top-or-bottom-dist (assoc-default
'top-or-bottom-pos
mouse-avoidance-banish-position 'eq))
(side-fn (case side
(left '+)
(right '-)))
(top-or-bottom-fn (case top-or-bottom
(top '+)
(bottom '-))))
mouse-avoidance-banish-position #'eq))
(side-fn (pcase side
(`left '+)
(`right '-)))
(top-or-bottom-fn (pcase top-or-bottom
(`top '+)
(`bottom '-))))
(cons (funcall side-fn ; -/+
(assoc-default side alist 'eq) ; right or left
side-dist) ; distance from side
......
......@@ -31,8 +31,7 @@
;;; Code:
(require 'timer)
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(defgroup battery nil
"Display battery status information."
......@@ -360,16 +359,16 @@ The following %-sequences are provided:
(when (re-search-forward "present: +yes$" nil t)
(when (re-search-forward "design capacity: +\\([0-9]+\\) m[AW]h$"
nil t)
(incf design-capacity (string-to-number (match-string 1))))
(cl-incf design-capacity (string-to-number (match-string 1))))
(when (re-search-forward "last full capacity: +\\([0-9]+\\) m[AW]h$"
nil t)
(incf last-full-capacity (string-to-number (match-string 1))))
(cl-incf last-full-capacity (string-to-number (match-string 1))))
(when (re-search-forward
"design capacity warning: +\\([0-9]+\\) m[AW]h$" nil t)
(incf warn (string-to-number (match-string 1))))
(cl-incf warn (string-to-number (match-string 1))))
(when (re-search-forward "design capacity low: +\\([0-9]+\\) m[AW]h$"
nil t)
(incf low (string-to-number (match-string 1)))))))
(cl-incf low (string-to-number (match-string 1)))))))
(setq full-capacity (if (> last-full-capacity 0)
last-full-capacity design-capacity))
(and capacity rate
......
......@@ -33,7 +33,7 @@
;;; Code:
(require 'pp)
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
;;; Misc comments:
;;
......@@ -2015,11 +2015,11 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
(tmp-list ()))
(while
(let ((char (read-key (concat prompt bookmark-search-pattern))))
(case char
((?\e ?\r) nil) ; RET or ESC break the search loop.
(pcase char
((or ?\e ?\r) nil) ; RET or ESC break the search loop.
(?\C-g (setq bookmark-quit-flag t) nil)
(?\d (pop tmp-list) t) ; Delete last char of pattern with DEL
(t
(_
(if (characterp char)
(push char tmp-list)
(setq unread-command-events
......@@ -2034,9 +2034,9 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
(defun bookmark-bmenu-filter-alist-by-regexp (regexp)
"Filter `bookmark-alist' with bookmarks matching REGEXP and rebuild list."
(let ((bookmark-alist
(loop for i in bookmark-alist
when (string-match regexp (car i)) collect i into new
finally return new)))
(cl-loop for i in bookmark-alist
when (string-match regexp (car i)) collect i into new
finally return new)))
(bookmark-bmenu-list)))
......
......@@ -124,8 +124,6 @@
;;; Code:
(eval-when-compile (require 'cl))
;; ----------------------------------------------------------------------
;; Globals for customization
;; ----------------------------------------------------------------------
......@@ -830,10 +828,10 @@ See `visit-tags-table'."
(interactive)
(let ((res
(with-current-buffer (bs--current-buffer)
(setq bs-buffer-show-mark (case bs-buffer-show-mark
((nil) 'never)
((never) 'always)
(t nil))))))
(setq bs-buffer-show-mark (pcase bs-buffer-show-mark
(`nil 'never)
(`never 'always)
(_ nil))))))
(bs--update-current-line)
(bs--set-window-height)
(bs--show-config-message res)))
......
......@@ -43,8 +43,6 @@
;;; History:
;; I hate history.
(eval-when-compile (require 'cl))
;;;=====================================================================
;;; Customization:
......
......@@ -101,7 +101,6 @@
;;; Code:
(eval-when-compile (require 'cl))
(require 'ring)
(require 'ansi-color)
(require 'regexp-opt) ;For regexp-opt-charset.
......
......@@ -29,8 +29,6 @@
;;; Code:
(eval-when-compile (require 'cl))
(defconst reference-point-alist
'((tl . 0) (tc . 1) (tr . 2)
(Bl . 3) (Bc . 4) (Br . 5)
......
......@@ -25,7 +25,6 @@
;;; Code:
(eval-when-compile (require 'cl))
(require 'widget)
(require 'cus-face)
......
......@@ -34,8 +34,6 @@
;;; Code:
(eval-when-compile (require 'cl))
;;; Customizable variables
(defgroup dired nil
......
......@@ -133,7 +133,7 @@
;;; Code:
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(require 'dired)
(require 'image-mode)
(require 'jka-compr)
......@@ -259,9 +259,9 @@ of the page moves to the previous page."
(setq ol nil))
(if ol
(progn
(assert (eq (overlay-buffer ol) (current-buffer)))
(cl-assert (eq (overlay-buffer ol) (current-buffer)))
(setq ol (copy-overlay ol)))
(assert (not (get-char-property (point-min) 'display)))
(cl-assert (not (get-char-property (point-min) 'display)))
(setq ol (make-overlay (point-min) (point-max) nil t))
(overlay-put ol 'doc-view t))
(overlay-put ol 'window (car winprops))
......@@ -892,30 +892,30 @@ Start by converting PAGES, and then the rest."
(defun doc-view-doc->txt (txt callback)
"Convert the current document to text and call CALLBACK when done."
(make-directory (doc-view-current-cache-dir) t)
(case doc-view-doc-type
(pdf
(pcase doc-view-doc-type
(`pdf
;; Doc is a PDF, so convert it to TXT
(doc-view-pdf->txt doc-view-buffer-file-name txt callback))
(ps
(`ps
;; Doc is a PS, so convert it to PDF (which will be converted to
;; TXT thereafter).
(let ((pdf (expand-file-name "doc.pdf"
(doc-view-current-cache-dir))))
(doc-view-ps->pdf doc-view-buffer-file-name pdf
(lambda () (doc-view-pdf->txt pdf txt callback)))))
(dvi
(`dvi
;; Doc is a DVI. This means that a doc.pdf already exists in its
;; cache subdirectory.
(doc-view-pdf->txt (expand-file-name "doc.pdf"
(doc-view-current-cache-dir))
txt callback))
(odf
(`odf
;; Doc is some ODF (or MS Office) doc. This means that a doc.pdf
;; already exists in its cache subdirectory.
(doc-view-pdf->txt (expand-file-name "doc.pdf"
(doc-view-current-cache-dir))
txt callback))
(t (error "DocView doesn't know what to do"))))
(_ (error "DocView doesn't know what to do"))))
(defun doc-view-ps->pdf (ps pdf callback)
"Convert PS to PDF asynchronously and call CALLBACK when finished."
......@@ -950,14 +950,14 @@ Those files are saved in the directory given by the function
(let ((png-file (expand-file-name "page-%d.png"
(doc-view-current-cache-dir))))
(make-directory (doc-view-current-cache-dir) t)
(case doc-view-doc-type
(dvi
(pcase doc-view-doc-type
(`dvi
;; DVI files have to be converted to PDF before Ghostscript can process
;; it.
(let ((pdf (expand-file-name "doc.pdf" doc-view-current-cache-dir)))
(doc-view-dvi->pdf doc-view-buffer-file-name pdf
(lambda () (doc-view-pdf/ps->png pdf png-file)))))
(odf
(`odf
;; ODF files have to be converted to PDF before Ghostscript can
;; process it.
(let ((pdf (expand-file-name "doc.pdf" doc-view-current-cache-dir))
......@@ -973,11 +973,11 @@ Those files are saved in the directory given by the function
;; Rename to doc.pdf
(rename-file opdf pdf)
(doc-view-pdf/ps->png pdf png-file)))))
(pdf
(`pdf
(let ((pages (doc-view-active-pages)))
;; Convert PDF to PNG images starting with the active pages.
(doc-view-pdf->png doc-view-buffer-file-name png-file pages)))
(t
(_
;; Convert to PNG images.
(doc-view-pdf/ps->png doc-view-buffer-file-name png-file)))))
......@@ -1103,7 +1103,7 @@ have the page we want to view."
(and (not (member pagefile prev-pages))
(member pagefile doc-view-current-files)))
(with-selected-window win
(assert (eq (current-buffer) buffer))
(cl-assert (eq (current-buffer) buffer))
(doc-view-goto-page page))))))))
(defun doc-view-buffer-message ()
......
This diff is collapsed.
......@@ -38,8 +38,6 @@
;;; Code:
(eval-when-compile (require 'cl))
;; This loop is the guts for non-standard modes which retain control
;; until some event occurs. It is a `do-forever', the only way out is
;; to throw. It assumes that you have set up the keymap, window, and
......@@ -394,16 +392,16 @@ arguments that returns one of those symbols.")
(not (nth 8 (save-excursion (syntax-ppss pos)))))
(let ((end (copy-marker (point) t)))
(goto-char pos)
(case (if (functionp rule) (funcall rule) rule)
(pcase (if (functionp rule) (funcall rule) rule)
;; FIXME: we used `newline' down here which called
;; self-insert-command and ran post-self-insert-hook recursively.
;; It happened to make electric-indent-mode work automatically with
;; electric-layout-mode (at the cost of re-indenting lines
;; multiple times), but I'm not sure it's what we want.
(before (goto-char (1- pos)) (skip-chars-backward " \t")
(`before (goto-char (1- pos)) (skip-chars-backward " \t")
(unless (bolp) (insert "\n")))
(after (insert "\n")) ; FIXME: check eolp before inserting \n?
(around (save-excursion
(`after (insert "\n")) ; FIXME: check eolp before inserting \n?
(`around (save-excursion
(goto-char (1- pos)) (skip-chars-backward " \t")
(unless (bolp) (insert "\n")))
(insert "\n"))) ; FIXME: check eolp before inserting \n?
......
......@@ -155,13 +155,14 @@ expression, in which case we want to handle forms differently."
define-overloadable-function))
(let* ((macrop (memq car '(defmacro defmacro*)))
(name (nth 1 form))
(args (cl-case car
((defun defmacro defun* defmacro*
define-overloadable-function) (nth 2 form))
((define-skeleton) '(&optional str arg))
((define-generic-mode define-derived-mode
define-compilation-mode) nil)
(t)))
(args (pcase car
((or `defun `defmacro
`defun* `defmacro* `cl-defun `cl-defmacro
`define-overloadable-function) (nth 2 form))
(`define-skeleton '(&optional str arg))
((or `define-generic-mode `define-derived-mode
`define-compilation-mode) nil)
(_ t)))
(body (nthcdr (or (get car 'doc-string-elt) 3) form))
(doc (if (stringp (car body)) (pop body))))
;; Add the usage form at the end where describe-function-1
......
......@@ -630,10 +630,10 @@
(while (eq (car-safe form) 'progn)
(setq form (car (last (cdr form)))))
(cond ((consp form)
(cl-case (car form)
(quote (cadr form))
(pcase (car form)
(`quote (cadr form))
;; Can't use recursion in a defsubst.
;; (progn (byte-compile-trueconstp (car (last (cdr form)))))
;; (`progn (byte-compile-trueconstp (car (last (cdr form)))))
))
((not (symbolp form)))
((eq form t))
......@@ -644,10 +644,10 @@
(while (eq (car-safe form) 'progn)
(setq form (car (last (cdr form)))))
(cond ((consp form)
(cl-case (car form)
(quote (null (cadr form)))