Subject: bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp

From: Mark Karpov <[email-masked]>
Date: Tue, 29 Sep 2015 22:43:43 +0600

In Common Lisp there is ‘constantly’ function:

  http://www.lispworks.com/documentation/HyperSpec/Body/f_cons_1.htm

which creates new function without side-effects that takes any number of
arguments and always returns specified value.

For some reason ‘cl-lib’ doesn't provide ‘cl-constantly’, so I guess it
should exist in pure Emacs Lisp under different name. However, I
couldn't find such a function, so I ask you to tell me name of function
that word like ‘constantly’ in Emacs Lisp or add ‘cl-constantly’ in
‘cl-lib’ in Emacs 25.

In GNU Emacs 25.0.50.21 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.7)
 of 2015-09-20
Repository revision: 6afe8168dde7780853003dea2fb9e3a8ba57e2ea
Windowing system distributor 'The X.Org Foundation', version 11.0.11702000
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ελ

Minor modes in effect:
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  rainbow-delimiters-mode: t
  hl-todo-mode: t
  whitespace-mode: t
  flyspell-mode: t
  flycheck-color-mode-line-mode: t
  flycheck-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  vimish-fold-global-mode: t
  vimish-fold-mode: t
  show-paren-mode: t
  rich-minority-mode: t
  minibuffer-electric-default-mode: t
  ido-vertical-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  highlight-line-mode: t
  global-auto-revert-mode: t
  global-aggressive-indent-mode: t
  aggressive-indent-mode: t
  display-time-mode: t
  delete-selection-mode: t
  cyphejor-mode: t
  ace-popup-menu-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  modalka-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t
  auto-fill-mode: 1

Recent messages:
Saving file /home/mark/projects/programs/emacs-lisp/para/para.el...
Wrote /home/mark/projects/programs/emacs-lisp/para/para.el
Undo! [2 times]
Mark set
Saving file /home/mark/projects/programs/emacs-lisp/para/para.el...
Wrote /home/mark/projects/programs/emacs-lisp/para/para.el
Type "q" in help window to restore its previous buffer.
Mark set
uncompressing cl-extra.el.gz...done
Note: file is write protected

Load-path shadows:
None found.

Features:
(shadow emacsbug sendmail org-rmail org-mhe org-irc org-info org-gnus
org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb
org-w3m markdown-mode hyperspec eieio-opt speedbar sb-image ezimage
dframe misearch multi-isearch zzz-to-char smex sort gnus-cite smiley
shr-color color shr dom browse-url qp mail-extr gnus-async gnus-bcklg
gnus-ml nndraft nnmh nnfolder utf-7 epa-file gnutls gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime dig nntp gnus-cache gnus-sum gnus-group gnus-undo
gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo
parse-time gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems nnheader
linum em-unix em-term term disp-table ehelp em-script em-prompt em-ls
em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias
haskell-doc inf-haskell haskell-decl-scan haskell haskell-completions
haskell-load haskell-commands highlight-uses-mode haskell-modules
haskell-sandbox haskell-repl haskell-debug haskell-interactive-mode
haskell-presentation-mode haskell-collapse haskell-navigate-imports
haskell-compile haskell-process haskell-session haskell-indentation
haskell-font-lock smartparens-haskell haskell-mode haskell-string
haskell-sort-imports haskell-lexeme haskell-align-imports haskell-compat
haskell-complete-module flymake dabbrev ace-window ebal warnings
ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init
ediff-util ediff recentf tree-widget wid-edit magit-blame magit-stash
magit-bisect magit-remote magit-commit epa magit-sequence magit esh-var
esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell
esh-module esh-mode esh-util dired-x magit-apply magit-wip magit-log
magit-diff smerge-mode magit-core magit-process magit-popup magit-mode
magit-git crm magit-section magit-utils git-commit log-edit pcvs-util
add-log with-editor async-bytecomp async cider-debug cider-mode
cider-resolve cider-browse-ns cider-inspector apropos cider-interaction
arc-mode archive-mode cider-overlays cider-test cider-stacktrace
cider-repl cider-eldoc cider-doc org-table org org-macro org-footnote
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs cal-menu calendar cal-loaddefs cider-popup cider-client
cider-common cider-util clojure-mode imenu nrepl-client derived queue
ewoc etags xref project spinner compile autoload lisp-mnt tar-mode
mm-archive message rfc822 mml mml-sec mailabbrev gmm-utils mailheader
mm-decode mm-bodies mm-encode mail-utils network-stream nsm starttls
url-http tls mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw
url-cache url-auth url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse url-vars epg vc vc-dispatcher smartparens-python python
tramp-sh tramp tramp-compat auth-source eieio eieio-core gnus-util
mm-util help-fns mail-prsvr password-cache tramp-loaddefs trampver shell
pcomplete format-spec json comint ansi-color hl-line dired vc-git
diff-mode bookmark pp rainbow-delimiters hl-todo whitespace flyspell
ispell flycheck-color-mode-line face-remap flycheck-haskell
haskell-cabal haskell-utils haskell-customize flycheck find-func rx
mk-visual smart-mode-line solarized-dark-theme solarized mk-texinfo
mk-tex mk-python mk-prolog mk-org mk-markdown mk-man mk-magit mk-lisp
mk-ibuffer mk-haskell mk-gnus mk-eshell mk-erc mk-elisp mk-dired
mk-clojure kill-or-bury-alive mk-calendar mk-c mk-minor-modes
common-lisp-snippets yasnippet cl whole-line-or-region vimish-fold paren
rich-minority minibuf-eldef ido-vertical-mode ido-ubiquitous
ido-completing-read+ cl-macs ido seq gv highlight-line autorevert
filenotify cl-seq aggressive-indent easy-mmode time delsel cyphejor
ace-popup-menu smartparens-config smartparens byte-opt thingatpt
mk-global modalka quail edmacro kmacro ace-link avy ring misc server
mk-utils subr-x f dash s ucs-normalize finder-inf tex-site fix-word
advice slime-autoloads info bytecomp byte-compile cl-extra help-mode
cl-loaddefs pcase cl-lib cconv package easymenu epg-config time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 781479 204206)
 (symbols 48 61227 1)
 (miscs 40 516 3062)
 (strings 32 153424 58089)
 (string-bytes 1 4678461)
 (vectors 16 85732)
 (vector-slots 8 2106091 65053)
 (floats 8 1124 1903)
 (intervals 56 6568 1724)
 (buffers 976 37)
 (heap 1024 88303 8794))