all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Automatically make a table with 16 columns
@ 2022-09-16  0:16 uzibalqa
  2022-09-16  7:26 ` Jean Louis
  0 siblings, 1 reply; 7+ messages in thread
From: uzibalqa @ 2022-09-16  0:16 UTC (permalink / raw)
  To: uzibalqa via Users list for the GNU Emacs text editor

How can I automatically make a table with 16 columns in the current buffer?  
The first row has numbers from 1 to 15, the second row from 16 to 31.  Followed
by an additional two rows with entries that are empty.

Would need it to like like this

1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

[16 empty entries]

[16 empty entries]






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

* Re: Automatically make a table with 16 columns
  2022-09-16  0:16 Automatically make a table with 16 columns uzibalqa
@ 2022-09-16  7:26 ` Jean Louis
  2022-09-16  8:12   ` uzibalqa
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Louis @ 2022-09-16  7:26 UTC (permalink / raw)
  To: uzibalqa; +Cc: uzibalqa via Users list for the GNU Emacs text editor

* uzibalqa <uzibalqa@proton.me> [2022-09-16 03:17]:
> How can I automatically make a table with 16 columns in the current buffer?  
> The first row has numbers from 1 to 15, the second row from 16 to 31.  Followed
> by an additional two rows with entries that are empty.
> 
> Would need it to like like this
> 
> 1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 
> 
> 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
> 
> [16 empty entries]
> 
> [16 empty entries]

(table-insert COLUMNS ROWS &optional CELL-WIDTH CELL-HEIGHT)

C-h f table-insert RET

or user Hyperbole package to invoke following link:

{C-h f table-insert RET}

(progn (insert "\n")
       (table-insert 3 3 4 1))
+----+----+----+
|    |    |    |
+----+----+----+
|    |    |    |
+----+----+----+
|    |    |    |
+----+----+----+

Once you generate your table, populate it:

+----+----+----+
| 1  | 2  | 3  |
+----+----+----+
| 4  | 5  | 6  |
+----+----+----+
|    |    |    |
+----+----+----+

once you have populated it, make function to insert it:

(defun my-table ()
  (interactive)
  (insert "
+----+----+----+
| 1  | 2  | 3  |
+----+----+----+
| 4  | 5  | 6  |
+----+----+----+
|    |    |    |
+----+----+----+
"))

invoke the function:

{M-x my-table RET}

+----+----+----+
| 1  | 2  | 3  |
+----+----+----+
| 4  | 5  | 6  |
+----+----+----+
|    |    |    |
+----+----+----+


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: Automatically make a table with 16 columns
  2022-09-16  7:26 ` Jean Louis
@ 2022-09-16  8:12   ` uzibalqa
  2022-09-16  8:42     ` Jean Louis
  0 siblings, 1 reply; 7+ messages in thread
From: uzibalqa @ 2022-09-16  8:12 UTC (permalink / raw)
  To: Jean Louis; +Cc: uzibalqa via Users list for the GNU Emacs text editor

------- Original Message -------
On Friday, September 16th, 2022 at 7:26 AM, Jean Louis <bugs@gnu.support> wrote:


> * uzibalqa uzibalqa@proton.me [2022-09-16 03:17]:
> 
> > How can I automatically make a table with 16 columns in the current buffer?
> > The first row has numbers from 1 to 15, the second row from 16 to 31. Followed
> > by an additional two rows with entries that are empty.
> > 
> > Would need it to like like this
> > 
> > 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
> > 
> > 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
> > 
> > [16 empty entries]
> > 
> > [16 empty entries]
> 
> 
> (table-insert COLUMNS ROWS &optional CELL-WIDTH CELL-HEIGHT)
> 
> C-h f table-insert RET
> 
> or user Hyperbole package to invoke following link:
> 
> {C-h f table-insert RET}
> 
> (progn (insert "\n")
> (table-insert 3 3 4 1))
> +----+----+----+
> | | | |
> +----+----+----+
> | | | |
> +----+----+----+
> | | | |
> +----+----+----+
> 
> Once you generate your table, populate it:
> 
> +----+----+----+
> | 1 | 2 | 3 |
> +----+----+----+
> | 4 | 5 | 6 |
> +----+----+----+
> | | | |
> +----+----+----+
> 
> once you have populated it

I have difficulty knowing how to populate the entries with lisp code.  Had a look at the Elisp Reference
but did not find much information.




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

* Re: Automatically make a table with 16 columns
  2022-09-16  8:12   ` uzibalqa
@ 2022-09-16  8:42     ` Jean Louis
  2022-09-16  9:07       ` uzibalqa
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Louis @ 2022-09-16  8:42 UTC (permalink / raw)
  To: uzibalqa; +Cc: uzibalqa via Users list for the GNU Emacs text editor

* uzibalqa <uzibalqa@proton.me> [2022-09-16 11:13]:
> > > Would need it to like like this
> > > 
> > > 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
> > > 
> > > 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
> > > 
> > > [16 empty entries]
> > > 
> > > [16 empty entries]
> I have difficulty knowing how to populate the entries with lisp code.  Had a look at the Elisp Reference
> but did not find much information.

Just populate by hand into function, and use function later to
duplicate it.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: Automatically make a table with 16 columns
  2022-09-16  8:42     ` Jean Louis
@ 2022-09-16  9:07       ` uzibalqa
  2022-09-16 10:23         ` Jean Louis
  0 siblings, 1 reply; 7+ messages in thread
From: uzibalqa @ 2022-09-16  9:07 UTC (permalink / raw)
  To: Jean Louis; +Cc: uzibalqa via Users list for the GNU Emacs text editor

------- Original Message -------
On Friday, September 16th, 2022 at 8:42 AM, Jean Louis <bugs@gnu.support> wrote:


> * uzibalqa uzibalqa@proton.me [2022-09-16 11:13]:
> 
> > > > Would need it to like like this
> > > > 
> > > > 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
> > > > 
> > > > 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
> > > > 
> > > > [16 empty entries]
> > > > 
> > > > [16 empty entries]
> > > > I have difficulty knowing how to populate the entries with lisp code. Had a look at the Elisp Reference
> > > > but did not find much information.
> 
> 
> Just populate by hand into function, and use function later to
> duplicate it.

What do you mean, populate it by hand?  How do you populate a table?



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

* Re: Automatically make a table with 16 columns
  2022-09-16  9:07       ` uzibalqa
@ 2022-09-16 10:23         ` Jean Louis
  2022-09-16 20:46           ` uzibalqa
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Louis @ 2022-09-16 10:23 UTC (permalink / raw)
  To: uzibalqa; +Cc: uzibalqa via Users list for the GNU Emacs text editor

* uzibalqa <uzibalqa@proton.me> [2022-09-16 12:08]:
> > Just populate by hand into function, and use function later to
> > duplicate it.
> 
> What do you mean, populate it by hand?  How do you populate a table?

Type it into the table.

| 1 | 2 | 3 | etc. |

and make it string:

"| 1 | 2 | 3 | etc. |"

and use function to return the string.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: Automatically make a table with 16 columns
  2022-09-16 10:23         ` Jean Louis
@ 2022-09-16 20:46           ` uzibalqa
  0 siblings, 0 replies; 7+ messages in thread
From: uzibalqa @ 2022-09-16 20:46 UTC (permalink / raw)
  To: Jean Louis; +Cc: uzibalqa via Users list for the GNU Emacs text editor

------- Original Message -------
On Friday, September 16th, 2022 at 10:23 AM, Jean Louis <bugs@gnu.support> wrote:


> * uzibalqa uzibalqa@proton.me [2022-09-16 12:08]:
> 
> > > Just populate by hand into function, and use function later to
> > > duplicate it.
> > 
> > What do you mean, populate it by hand? How do you populate a table?
> 
> 
> Type it into the table.
> 
> | 1 | 2 | 3 | etc. |
> 
> and make it string:
> 
> "| 1 | 2 | 3 | etc. |"
> 
> and use function to return the string.

The plan is not to type it directly into the buffer displaying the table, but to
have a function call that makes and populates the table using a template, with 
some entries not populated for input by the user.




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

end of thread, other threads:[~2022-09-16 20:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-16  0:16 Automatically make a table with 16 columns uzibalqa
2022-09-16  7:26 ` Jean Louis
2022-09-16  8:12   ` uzibalqa
2022-09-16  8:42     ` Jean Louis
2022-09-16  9:07       ` uzibalqa
2022-09-16 10:23         ` Jean Louis
2022-09-16 20:46           ` uzibalqa

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.