all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What does the _ in `(defun org-element-section-parser (_) ...)' stands for?
@ 2016-02-09 17:45 Thorsten Jolitz
  2016-02-09 18:59 ` John Kitchin
  0 siblings, 1 reply; 8+ messages in thread
From: Thorsten Jolitz @ 2016-02-09 17:45 UTC (permalink / raw)
  To: emacs-orgmode


Hi List,
just out of curiosity, a few functions in org-element.el contain _ in
their parameter list, but its not used in the body. 
What does it stand for?

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What does the _ in `(defun org-element-section-parser (_) ...)' stands for?
  2016-02-09 17:45 What does the _ in `(defun org-element-section-parser (_) ...)' stands for? Thorsten Jolitz
@ 2016-02-09 18:59 ` John Kitchin
  2016-02-10 20:13   ` Thorsten Jolitz
  0 siblings, 1 reply; 8+ messages in thread
From: John Kitchin @ 2016-02-09 18:59 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

I guess it is a required signature for the function (i.e. some other
function will call it with some argument), and _ indicates it is not
used in the body. If you were to give it the arg a name, then checkdoc
would complain about it not being in the docstring.

Thorsten Jolitz writes:

> Hi List,
> just out of curiosity, a few functions in org-element.el contain _ in
> their parameter list, but its not used in the body.
> What does it stand for?


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What does the _ in `(defun org-element-section-parser (_) ...)' stands for?
  2016-02-09 18:59 ` John Kitchin
@ 2016-02-10 20:13   ` Thorsten Jolitz
  2016-02-10 20:47     ` John Kitchin
  0 siblings, 1 reply; 8+ messages in thread
From: Thorsten Jolitz @ 2016-02-10 20:13 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I guess it is a required signature for the function (i.e. some other
> function will call it with some argument), and _ indicates it is not
> used in the body. If you were to give it the arg a name, then checkdoc
> would complain about it not being in the docstring.

Sounds reasonable, thanks for the explanation.
But it does not seem to be a true guess, I tried it out with:

#+BEGIN_SRC emacs-lisp
(defun my-foo (_)
  "Hello World.
Argument _ unknown argument."
  (+ 1 1))
#+END_SRC

and checkdoc asked me to add the "Argument ..." part for "_" to the docstring.

I don't remember that I've seen this before, so maybe this is a rather new
feature/convention?

> Thorsten Jolitz writes:
>
>> Hi List,
>> just out of curiosity, a few functions in org-element.el contain _ in
>> their parameter list, but its not used in the body.
>> What does it stand for?
>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What does the _ in `(defun org-element-section-parser (_) ...)' stands for?
  2016-02-10 20:13   ` Thorsten Jolitz
@ 2016-02-10 20:47     ` John Kitchin
  2016-02-11 17:10       ` Thorsten Jolitz
  0 siblings, 1 reply; 8+ messages in thread
From: John Kitchin @ 2016-02-10 20:47 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

On Wed, Feb 10, 2016 at 3:13 PM, Thorsten Jolitz <tjolitz@gmail.com> wrote:

> #+BEGIN_SRC emacs-lisp
> (defun my-foo (_)
>   "Hello World.
> Argument _ unknown argument."
>   (+ 1 1))
> #+END_SRC
>

strange. in Emacs 25.1, I am pretty sure I get no errors from checkdoc.



John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

[-- Attachment #2: Type: text/html, Size: 1176 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What does the _ in `(defun org-element-section-parser (_) ...)' stands for?
  2016-02-10 20:47     ` John Kitchin
@ 2016-02-11 17:10       ` Thorsten Jolitz
  2016-02-11 17:20         ` John Kitchin
  2016-02-11 17:33         ` Nick Dokos
  0 siblings, 2 replies; 8+ messages in thread
From: Thorsten Jolitz @ 2016-02-11 17:10 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> On Wed, Feb 10, 2016 at 3:13 PM, Thorsten Jolitz <tjolitz@gmail.com>
> wrote:
>
>     #+BEGIN_SRC emacs-lisp
>     (defun my-foo (_)
>     "Hello World.
>     Argument _ unknown argument."
>     (+ 1 1))
>     #+END_SRC
>
> strange. in Emacs 25.1, I am pretty sure I get no errors from
> checkdoc.

Maybe not so strange, since I'm on:

,----
| GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
|  of 2015-09-10 on foutrelis
`----

And I thought with Archlinux I'm always up-to-date ...

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What does the _ in `(defun org-element-section-parser (_) ...)' stands for?
  2016-02-11 17:10       ` Thorsten Jolitz
@ 2016-02-11 17:20         ` John Kitchin
  2016-02-11 17:33         ` Nick Dokos
  1 sibling, 0 replies; 8+ messages in thread
From: John Kitchin @ 2016-02-11 17:20 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]

There is up to date ... And up to date😉 funnily enough I run a near
bleeding edge version of Emacs from home brew and org 8.2.10 from Melpa.

On Thursday, February 11, 2016, Thorsten Jolitz <tjolitz@gmail.com> wrote:

> John Kitchin <jkitchin@andrew.cmu.edu <javascript:;>> writes:
>
> > On Wed, Feb 10, 2016 at 3:13 PM, Thorsten Jolitz <tjolitz@gmail.com
> <javascript:;>>
> > wrote:
> >
> >     #+BEGIN_SRC emacs-lisp
> >     (defun my-foo (_)
> >     "Hello World.
> >     Argument _ unknown argument."
> >     (+ 1 1))
> >     #+END_SRC
> >
> > strange. in Emacs 25.1, I am pretty sure I get no errors from
> > checkdoc.
>
> Maybe not so strange, since I'm on:
>
> ,----
> | GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
> |  of 2015-09-10 on foutrelis
> `----
>
> And I thought with Archlinux I'm always up-to-date ...
>
> --
> cheers,
> Thorsten
>
>
>

-- 
John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

[-- Attachment #2: Type: text/html, Size: 1819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What does the _ in `(defun org-element-section-parser (_) ...)' stands for?
  2016-02-11 17:10       ` Thorsten Jolitz
  2016-02-11 17:20         ` John Kitchin
@ 2016-02-11 17:33         ` Nick Dokos
  2016-02-14 16:45           ` John Kitchin
  1 sibling, 1 reply; 8+ messages in thread
From: Nick Dokos @ 2016-02-11 17:33 UTC (permalink / raw)
  To: emacs-orgmode

Thorsten Jolitz <tjolitz@gmail.com> writes:

> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> On Wed, Feb 10, 2016 at 3:13 PM, Thorsten Jolitz <tjolitz@gmail.com>
>> wrote:
>>
>>     #+BEGIN_SRC emacs-lisp
>>     (defun my-foo (_)
>>     "Hello World.
>>     Argument _ unknown argument."
>>     (+ 1 1))
>>     #+END_SRC
>>
>> strange. in Emacs 25.1, I am pretty sure I get no errors from
>> checkdoc.
>
> Maybe not so strange, since I'm on:
>
> ,----
> | GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
> |  of 2015-09-10 on foutrelis
> `----
>
> And I thought with Archlinux I'm always up-to-date ...

Unless you build your own from the upstream git repo, you can never be
up to date; even so, it depends on how often you build - I build from
upstream every six months or so and my current version is

GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.15) of
2015-08-16

It's probably time to rebuild...

--
Nick

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What does the _ in `(defun org-element-section-parser (_) ...)' stands for?
  2016-02-11 17:33         ` Nick Dokos
@ 2016-02-14 16:45           ` John Kitchin
  0 siblings, 0 replies; 8+ messages in thread
From: John Kitchin @ 2016-02-14 16:45 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1655 bytes --]

FYI, I found this today:

(To silence byte-compiler warnings about unused variables, just use a
variable name that start with an underscore. The byte-compiler interprets
this as an indication that this is a variable known not to be used.)

https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Thu, Feb 11, 2016 at 12:33 PM, Nick Dokos <ndokos@gmail.com> wrote:

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
> > John Kitchin <jkitchin@andrew.cmu.edu> writes:
> >
> >> On Wed, Feb 10, 2016 at 3:13 PM, Thorsten Jolitz <tjolitz@gmail.com>
> >> wrote:
> >>
> >>     #+BEGIN_SRC emacs-lisp
> >>     (defun my-foo (_)
> >>     "Hello World.
> >>     Argument _ unknown argument."
> >>     (+ 1 1))
> >>     #+END_SRC
> >>
> >> strange. in Emacs 25.1, I am pretty sure I get no errors from
> >> checkdoc.
> >
> > Maybe not so strange, since I'm on:
> >
> > ,----
> > | GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
> > |  of 2015-09-10 on foutrelis
> > `----
> >
> > And I thought with Archlinux I'm always up-to-date ...
>
> Unless you build your own from the upstream git repo, you can never be
> up to date; even so, it depends on how often you build - I build from
> upstream every six months or so and my current version is
>
> GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.15) of
> 2015-08-16
>
> It's probably time to rebuild...
>
> --
> Nick
>
>
>

[-- Attachment #2: Type: text/html, Size: 2995 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-14 16:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-09 17:45 What does the _ in `(defun org-element-section-parser (_) ...)' stands for? Thorsten Jolitz
2016-02-09 18:59 ` John Kitchin
2016-02-10 20:13   ` Thorsten Jolitz
2016-02-10 20:47     ` John Kitchin
2016-02-11 17:10       ` Thorsten Jolitz
2016-02-11 17:20         ` John Kitchin
2016-02-11 17:33         ` Nick Dokos
2016-02-14 16:45           ` John Kitchin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.