GNU bug report logs - #21584
25.0.50; Please add cl-constantly function from Common Lisp

Previous Next

Package: emacs;

Reported by: Mark Karpov <markkarpov <at> openmailbox.org>

Date: Tue, 29 Sep 2015 17:29:02 UTC

Severity: wishlist

Found in version 25.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21584 in the body.
You can then email your comments to 21584 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21584; Package emacs. (Tue, 29 Sep 2015 17:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mark Karpov <markkarpov <at> openmailbox.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 29 Sep 2015 17:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark Karpov <markkarpov <at> openmailbox.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; Please add cl-constantly function from Common Lisp
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))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21584; Package emacs. (Thu, 01 Oct 2015 02:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 21584 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Mark Karpov <markkarpov <at> openmailbox.org>
Cc: 21584 <at> debbugs.gnu.org
Subject: Re: bug#21584: 25.0.50;
 Please add cl-constantly function from Common Lisp
Date: Wed, 30 Sep 2015 22:26:04 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Maybe we can add 'constantly' to Emacs outside the cl package.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21584; Package emacs. (Thu, 01 Oct 2015 12:59:02 GMT) Full text and rfc822 format available.

Message #11 received at 21584 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Petton <nicolas <at> petton.fr>
To: rms <at> gnu.org, Mark Karpov <markkarpov <at> openmailbox.org>
Cc: 21584 <at> debbugs.gnu.org
Subject: Re: bug#21584: 25.0.50;
 Please add cl-constantly function from Common Lisp
Date: Thu, 01 Oct 2015 14:58:34 +0200
[Message part 1 (text/plain, inline)]
Richard Stallman <rms <at> gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> Maybe we can add 'constantly' to Emacs outside the cl package.

Do you mean as a standard documented function, in subr.el?  Or maybe in
subr-x.el?

Nico
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21584; Package emacs. (Fri, 02 Oct 2015 02:28:01 GMT) Full text and rfc822 format available.

Message #14 received at 21584 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Nicolas Petton <nicolas <at> petton.fr>
Cc: 21584 <at> debbugs.gnu.org, markkarpov <at> openmailbox.org
Subject: Re: bug#21584: 25.0.50;
 Please add cl-constantly function from Common Lisp
Date: Thu, 01 Oct 2015 22:27:12 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Maybe we can add 'constantly' to Emacs outside the cl package.

  > Do you mean as a standard documented function

Yes.

What file to put it in is a detail I am not addressing.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21584; Package emacs. (Fri, 02 Oct 2015 04:53:02 GMT) Full text and rfc822 format available.

Message #17 received at 21584 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Colascione <dancol <at> dancol.org>
To: rms <at> gnu.org, Nicolas Petton <nicolas <at> petton.fr>
Cc: 21584 <at> debbugs.gnu.org, markkarpov <at> openmailbox.org
Subject: Re: bug#21584: 25.0.50; Please add cl-constantly function from Common
 Lisp
Date: Thu, 1 Oct 2015 21:52:47 -0700
[Message part 1 (text/plain, inline)]
On 10/01/2015 07:27 PM, Richard Stallman wrote:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
>   > > Maybe we can add 'constantly' to Emacs outside the cl package.
> 
>   > Do you mean as a standard documented function
> 
> Yes.
> 
> What file to put it in is a detail I am not addressing.

I thought we weren't adding unnamespaced functions anymore.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21584; Package emacs. (Sat, 03 Oct 2015 01:37:02 GMT) Full text and rfc822 format available.

Message #20 received at 21584 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: nicolas <at> petton.fr, 21584 <at> debbugs.gnu.org, markkarpov <at> openmailbox.org
Subject: Re: bug#21584: 25.0.50;
 Please add cl-constantly function from Common Lisp
Date: Fri, 02 Oct 2015 21:36:00 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I thought we weren't adding unnamespaced functions anymore.

For a general-purpose useful function, such as this one, that is 
the way to add it -- if we are going to add it.


-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21584; Package emacs. (Thu, 02 Dec 2021 09:20:02 GMT) Full text and rfc822 format available.

Message #23 received at 21584 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mark Karpov <markkarpov <at> openmailbox.org>
Cc: 21584 <at> debbugs.gnu.org
Subject: Re: bug#21584: 25.0.50; Please add cl-constantly function from
 Common Lisp
Date: Thu, 02 Dec 2021 10:19:31 +0100
Mark Karpov <markkarpov <at> openmailbox.org> writes:

> 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.

I've now added `cl-constantly' to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 21584 <at> debbugs.gnu.org and Mark Karpov <markkarpov <at> openmailbox.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 02 Dec 2021 09:20:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 Dec 2021 12:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.