Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

put elisp numerical output into buffer

9 views
Skip to first unread message

Richard Smith

unread,
May 23, 2020, 12:21:10 PM5/23/20
to
Hello all

Only posted once before, many years ago, so please be gentle with me!

How do you make a computer program output to a text buffer of your
chosing? So that at the end of the program run you can save (C-x
C-f).

I use "C-u C-x C-e" frequently.

But haven't found how to pick up a big output direct out like the
example appended into a buffer.

I've never studied this, and pick up "messages" in the "Message"
buffer and copy and paste. Proper method would be good.

I suspect this is a very common question. Could you point me in the
right direction?

By the way - I use emacs lisp for general programming because emacs is
already there on the computer and it does absolutely fine for all my
programming needs.
It objects to a lot of recursion, which could run to several million
recursions for a fine accurate solution (though is tail-recursive),
but a looping expression is easily done and can do millions of loops
readily.

Also advantage emacs is the opportunity to inject the answer straight
into the buffer / file with your notes.

Regards,
Rich Smith

-------- Appendix - Example heat computation --------

Model:
57mm wall thickness
HF-induction-heat penetrates 2mm uniformly
Wall outer temperature is prevented from exceeding 260C by controlling heat input

itn=0 [ 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 ] avg-T=20.000000
itn=1200 [ 260.0 260.0 260.0 257.2 254.5 249.0 243.4 237.9 232.5 227.0 221.6 216.2 210.8 205.5 200.2 195.0 189.8 184.7 179.6 174.6 169.7 164.8 160.0 155.3 150.7 146.1 141.6 137.3 132.9 128.7 124.6 120.6 116.6 112.8 109.0 105.4 101.8 98.4 95.0 91.7 88.5 85.5 82.5 79.6 76.8 74.1 71.5 69.0 66.5 64.2 62.0 59.8 57.7 55.8 53.8 52.0 50.2 48.6 47.0 45.5 44.0 42.6 41.2 40.0 38.8 37.7 36.5 35.5 34.5 33.6 32.7 31.9 31.1 30.4 29.7 29.1 28.4 27.9 27.3 26.8 26.3 25.9 25.4 25.0 24.7 24.3 24.0 23.7 23.4 23.2 22.9 22.7 22.5 22.3 22.1 21.9 21.8 21.7 21.5 21.4 21.3 21.2 21.1 21.0 21.0 20.9 20.9 20.8 20.8 20.7 20.7 20.7 20.7 20.7 ] avg-T=85.544788
itn=2400 [ 260.0 260.0 260.0 258.0 256.1 252.2 248.3 244.4 240.5 236.6 232.7 228.9 225.0 221.2 217.4 213.6 209.8 206.0 202.3 198.6 194.9 191.2 187.6 184.0 180.4 176.8 173.3 169.8 166.4 163.0 159.6 156.3 153.0 149.7 146.5 143.3 140.2 137.1 134.0 131.0 128.1 125.2 122.3 119.5 116.7 114.0 111.3 108.7 106.1 103.6 101.1 98.6 96.2 93.9 91.6 89.4 87.2 85.1 82.9 80.9 78.9 77.0 75.1 73.2 71.4 69.7 67.9 66.3 64.6 63.1 61.5 60.1 58.6 57.2 55.9 54.6 53.3 52.1 50.9 49.7 48.6 47.6 46.5 45.6 44.6 43.7 42.8 42.0 41.2 40.4 39.7 39.0 38.3 37.7 37.1 36.5 36.0 35.5 35.0 34.6 34.2 33.8 33.4 33.1 32.8 32.6 32.4 32.2 32.0 31.9 31.7 31.7 31.6 31.6 ] avg-T=109.650533
itn=3600 [ 260.0 260.0 260.0 258.4 256.8 253.6 250.5 247.3 244.1 240.9 237.8 234.6 231.5 228.3 225.2 222.1 218.9 215.8 212.7 209.7 206.6 203.6 200.5 197.5 194.5 191.5 188.6 185.6 182.7 179.8 176.9 174.1 171.2 168.5 165.7 162.9 160.2 157.5 154.8 152.1 149.5 146.9 144.3 141.8 139.3 136.8 134.4 132.0 129.6 127.2 124.9 122.6 120.4 118.2 116.0 113.8 111.7 109.7 107.6 105.6 103.6 101.7 99.8 97.9 96.1 94.3 92.5 90.8 89.1 87.5 85.9 84.3 82.7 81.3 79.8 78.4 77.0 75.6 74.3 73.0 71.8 70.6 69.4 68.3 67.2 66.1 65.1 64.2 63.2 62.3 61.4 60.6 59.8 59.0 58.3 57.6 57.0 56.4 55.8 55.2 54.7 54.3 53.8 53.4 53.1 52.8 52.5 52.2 52.0 51.8 51.7 51.6 51.5 51.5 ] avg-T=128.132893
itn=4800 [ 260.0 260.0 260.0 258.6 257.3 254.5 251.8 249.1 246.4 243.6 240.9 238.2 235.5 232.8 230.1 227.4 224.7 222.1 219.4 216.8 214.1 211.5 208.9 206.3 203.7 201.1 198.5 195.9 193.4 190.9 188.4 185.9 183.4 180.9 178.5 176.1 173.7 171.3 168.9 166.6 164.2 162.0 159.7 157.4 155.2 153.0 150.8 148.6 146.5 144.4 142.3 140.2 138.2 136.2 134.2 132.2 130.3 128.4 126.5 124.7 122.8 121.1 119.3 117.6 115.9 114.2 112.6 111.0 109.4 107.9 106.3 104.9 103.4 102.0 100.6 99.3 97.9 96.6 95.4 94.2 93.0 91.8 90.7 89.6 88.6 87.5 86.6 85.6 84.7 83.8 83.0 82.1 81.4 80.6 79.9 79.2 78.6 78.0 77.4 76.9 76.4 75.9 75.5 75.1 74.8 74.4 74.2 73.9 73.7 73.5 73.4 73.3 73.2 73.2 ] avg-T=143.627450
itn=6000 [ 260.0 260.0 260.0 258.8 257.6 255.2 252.8 250.5 248.1 245.7 243.3 240.9 238.6 236.2 233.8 231.5 229.1 226.8 224.5 222.1 219.8 217.5 215.2 212.9 210.6 208.4 206.1 203.9 201.6 199.4 197.2 195.0 192.8 190.6 188.5 186.4 184.2 182.1 180.0 178.0 175.9 173.9 171.8 169.8 167.8 165.9 163.9 162.0 160.1 158.2 156.4 154.5 152.7 150.9 149.1 147.4 145.6 143.9 142.3 140.6 139.0 137.4 135.8 134.2 132.7 131.2 129.7 128.3 126.8 125.5 124.1 122.7 121.4 120.1 118.9 117.7 116.5 115.3 114.1 113.0 111.9 110.9 109.9 108.9 107.9 107.0 106.1 105.2 104.4 103.6 102.8 102.0 101.3 100.6 100.0 99.4 98.8 98.2 97.7 97.2 96.8 96.3 95.9 95.6 95.3 95.0 94.7 94.5 94.3 94.1 94.0 93.9 93.8 93.8 ] avg-T=157.062221
itn=7200 [ 260.0 260.0 260.0 258.9 257.9 255.8 253.7 251.6 249.5 247.4 245.3 243.2 241.1 239.0 236.9 234.9 232.8 230.7 228.7 226.6 224.6 222.5 220.5 218.5 216.5 214.5 212.5 210.5 208.5 206.5 204.6 202.6 200.7 198.8 196.9 195.0 193.1 191.3 189.4 187.6 185.7 183.9 182.1 180.4 178.6 176.9 175.1 173.4 171.7 170.1 168.4 166.8 165.2 163.6 162.0 160.4 158.9 157.4 155.9 154.4 153.0 151.5 150.1 148.7 147.4 146.0 144.7 143.4 142.1 140.9 139.7 138.5 137.3 136.1 135.0 133.9 132.9 131.8 130.8 129.8 128.8 127.9 127.0 126.1 125.2 124.4 123.6 122.8 122.0 121.3 120.6 119.9 119.3 118.7 118.1 117.6 117.0 116.5 116.1 115.6 115.2 114.8 114.5 114.1 113.9 113.6 113.3 113.1 113.0 112.8 112.7 112.6 112.6 112.5 ] avg-T=168.865583
itn=8400 [ 260.0 260.0 260.0 259.1 258.1 256.3 254.4 252.6 250.7 248.8 247.0 245.1 243.3 241.5 239.6 237.8 235.9 234.1 232.3 230.5 228.7 226.9 225.1 223.3 221.5 219.7 218.0 216.2 214.5 212.7 211.0 209.3 207.6 205.9 204.2 202.5 200.8 199.2 197.5 195.9 194.3 192.7 191.1 189.5 188.0 186.4 184.9 183.4 181.9 180.4 178.9 177.5 176.1 174.6 173.2 171.9 170.5 169.2 167.8 166.5 165.2 164.0 162.7 161.5 160.3 159.1 157.9 156.8 155.6 154.5 153.4 152.4 151.3 150.3 149.3 148.3 147.4 146.4 145.5 144.6 143.8 142.9 142.1 141.3 140.6 139.8 139.1 138.4 137.8 137.1 136.5 135.9 135.3 134.8 134.3 133.8 133.3 132.8 132.4 132.0 131.7 131.3 131.0 130.7 130.5 130.2 130.0 129.8 129.7 129.5 129.4 129.4 129.3 129.3 ] avg-T=179.288486
itn=9600 [ 260.0 260.0 260.0 259.2 258.4 256.7 255.1 253.4 251.8 250.1 248.5 246.8 245.2 243.6 242.0 240.3 238.7 237.1 235.5 233.9 232.3 230.7 229.1 227.5 225.9 224.3 222.8 221.2 219.7 218.1 216.6 215.1 213.6 212.1 210.6 209.1 207.6 206.2 204.7 203.3 201.8 200.4 199.0 197.6 196.2 194.9 193.5 192.2 190.8 189.5 188.2 186.9 185.7 184.4 183.2 181.9 180.7 179.5 178.4 177.2 176.1 174.9 173.8 172.7 171.7 170.6 169.6 168.6 167.6 166.6 165.6 164.7 163.7 162.8 161.9 161.1 160.2 159.4 158.6 157.8 157.1 156.3 155.6 154.9 154.2 153.5 152.9 152.3 151.7 151.1 150.6 150.0 149.5 149.1 148.6 148.2 147.7 147.3 147.0 146.6 146.3 146.0 145.7 145.5 145.2 145.0 144.8 144.7 144.5 144.4 144.3 144.3 144.2 144.2 ] avg-T=188.510261
itn=10800 [ 260.0 260.0 260.0 259.3 258.5 257.1 255.6 254.2 252.7 251.3 249.8 248.4 246.9 245.5 244.0 242.6 241.1 239.7 238.3 236.9 235.4 234.0 232.6 231.2 229.8 228.4 227.0 225.7 224.3 222.9 221.6 220.2 218.9 217.6 216.2 214.9 213.6 212.3 211.0 209.7 208.5 207.2 206.0 204.7 203.5 202.3 201.1 199.9 198.7 197.6 196.4 195.3 194.2 193.1 192.0 190.9 189.8 188.7 187.7 186.7 185.7 184.7 183.7 182.7 181.8 180.8 179.9 179.0 178.1 177.2 176.4 175.6 174.7 173.9 173.1 172.4 171.6 170.9 170.2 169.5 168.8 168.1 167.5 166.9 166.3 165.7 165.1 164.6 164.1 163.6 163.1 162.6 162.1 161.7 161.3 160.9 160.6 160.2 159.9 159.6 159.3 159.0 158.8 158.5 158.3 158.1 158.0 157.8 157.7 157.6 157.5 157.5 157.4 157.4 ] avg-T=196.675346
itn=11335 -- heating turned off
itn=11335 [ 260.0 260.0 260.0 259.3 258.6 257.2 255.9 254.5 253.1 251.7 250.3 249.0 247.6 246.2 244.9 243.5 242.1 240.8 239.4 238.1 236.7 235.4 234.1 232.7 231.4 230.1 228.8 227.5 226.2 224.9 223.6 222.3 221.0 219.8 218.5 217.3 216.0 214.8 213.6 212.4 211.2 210.0 208.8 207.6 206.5 205.3 204.2 203.1 202.0 200.9 199.8 198.7 197.6 196.6 195.5 194.5 193.5 192.5 191.5 190.5 189.6 188.6 187.7 186.8 185.9 185.0 184.1 183.3 182.4 181.6 180.8 180.0 179.2 178.5 177.7 177.0 176.3 175.6 174.9 174.2 173.6 173.0 172.4 171.8 171.2 170.7 170.1 169.6 169.1 168.6 168.2 167.7 167.3 166.9 166.5 166.1 165.8 165.4 165.1 164.8 164.6 164.3 164.1 163.9 163.7 163.5 163.3 163.2 163.1 163.0 162.9 162.8 162.8 162.8 ] avg-T=200.001936
itn=12000 [ 237.1 237.0 236.9 236.8 236.7 236.5 236.3 236.0 235.7 235.4 235.0 234.6 234.2 233.7 233.2 232.7 232.1 231.5 230.9 230.3 229.6 228.9 228.2 227.5 226.7 225.9 225.1 224.3 223.5 222.6 221.8 220.9 220.0 219.1 218.2 217.3 216.3 215.4 214.4 213.5 212.5 211.6 210.6 209.7 208.7 207.7 206.8 205.8 204.9 203.9 203.0 202.0 201.1 200.2 199.3 198.3 197.4 196.5 195.7 194.8 193.9 193.0 192.2 191.4 190.5 189.7 188.9 188.1 187.4 186.6 185.9 185.1 184.4 183.7 183.0 182.3 181.7 181.0 180.4 179.8 179.2 178.6 178.1 177.5 177.0 176.5 176.0 175.5 175.0 174.6 174.1 173.7 173.3 172.9 172.6 172.2 171.9 171.6 171.3 171.0 170.8 170.5 170.3 170.1 169.9 169.8 169.6 169.5 169.4 169.3 169.2 169.2 169.1 169.1 ] avg-T=200.001936
itn=13200 [ 221.8 221.8 221.8 221.7 221.6 221.5 221.4 221.3 221.2 221.0 220.8 220.7 220.4 220.2 220.0 219.7 219.5 219.2 218.9 218.5 218.2 217.9 217.5 217.1 216.7 216.3 215.9 215.5 215.1 214.6 214.2 213.7 213.2 212.7 212.2 211.7 211.2 210.7 210.1 209.6 209.1 208.5 207.9 207.4 206.8 206.2 205.7 205.1 204.5 203.9 203.3 202.7 202.2 201.6 201.0 200.4 199.8 199.2 198.6 198.0 197.5 196.9 196.3 195.7 195.2 194.6 194.1 193.5 193.0 192.4 191.9 191.4 190.9 190.3 189.8 189.4 188.9 188.4 187.9 187.5 187.0 186.6 186.2 185.7 185.3 184.9 184.6 184.2 183.8 183.5 183.1 182.8 182.5 182.2 181.9 181.7 181.4 181.2 180.9 180.7 180.5 180.3 180.1 180.0 179.8 179.7 179.6 179.5 179.4 179.3 179.3 179.2 179.2 179.2 ] avg-T=200.001936
itn=14400 [ 213.6 213.6 213.6 213.5 213.5 213.4 213.4 213.3 213.2 213.1 213.0 212.9 212.8 212.6 212.5 212.4 212.2 212.0 211.8 211.6 211.4 211.2 211.0 210.8 210.6 210.3 210.1 209.8 209.6 209.3 209.0 208.7 208.4 208.1 207.8 207.5 207.2 206.9 206.6 206.2 205.9 205.5 205.2 204.9 204.5 204.1 203.8 203.4 203.1 202.7 202.3 202.0 201.6 201.2 200.9 200.5 200.1 199.7 199.4 199.0 198.6 198.3 197.9 197.5 197.2 196.8 196.4 196.1 195.7 195.4 195.0 194.7 194.4 194.0 193.7 193.4 193.0 192.7 192.4 192.1 191.8 191.5 191.3 191.0 190.7 190.4 190.2 189.9 189.7 189.5 189.2 189.0 188.8 188.6 188.4 188.3 188.1 187.9 187.8 187.6 187.5 187.3 187.2 187.1 187.0 186.9 186.9 186.8 186.7 186.7 186.6 186.6 186.6 186.6 ] avg-T=200.001936
itn=15600 [ 208.6 208.6 208.6 208.5 208.5 208.5 208.4 208.4 208.3 208.3 208.2 208.2 208.1 208.0 207.9 207.8 207.7 207.6 207.5 207.4 207.2 207.1 207.0 206.8 206.7 206.5 206.4 206.2 206.1 205.9 205.7 205.5 205.4 205.2 205.0 204.8 204.6 204.4 204.2 204.0 203.8 203.5 203.3 203.1 202.9 202.7 202.4 202.2 202.0 201.7 201.5 201.3 201.0 200.8 200.6 200.3 200.1 199.9 199.6 199.4 199.2 198.9 198.7 198.5 198.2 198.0 197.8 197.5 197.3 197.1 196.9 196.7 196.4 196.2 196.0 195.8 195.6 195.4 195.2 195.0 194.8 194.6 194.5 194.3 194.1 193.9 193.8 193.6 193.5 193.3 193.2 193.0 192.9 192.8 192.6 192.5 192.4 192.3 192.2 192.1 192.0 191.9 191.9 191.8 191.7 191.7 191.6 191.6 191.5 191.5 191.5 191.5 191.5 191.4 ] avg-T=200.001936
itn=16800 [ 205.4 205.4 205.4 205.4 205.4 205.4 205.3 205.3 205.3 205.2 205.2 205.2 205.1 205.1 205.0 204.9 204.9 204.8 204.7 204.7 204.6 204.5 204.4 204.3 204.2 204.1 204.0 203.9 203.8 203.7 203.6 203.5 203.4 203.3 203.2 203.0 202.9 202.8 202.7 202.5 202.4 202.3 202.1 202.0 201.8 201.7 201.5 201.4 201.3 201.1 201.0 200.8 200.7 200.5 200.4 200.2 200.1 199.9 199.8 199.6 199.5 199.3 199.2 199.0 198.9 198.7 198.6 198.5 198.3 198.2 198.0 197.9 197.8 197.6 197.5 197.4 197.2 197.1 197.0 196.8 196.7 196.6 196.5 196.4 196.3 196.2 196.1 196.0 195.9 195.8 195.7 195.6 195.5 195.4 195.3 195.3 195.2 195.1 195.1 195.0 194.9 194.9 194.8 194.8 194.8 194.7 194.7 194.7 194.6 194.6 194.6 194.6 194.6 194.6 ] avg-T=200.001936
itn=17019 [ 205.0 205.0 205.0 205.0 205.0 204.9 204.9 204.9 204.9 204.8 204.8 204.8 204.7 204.7 204.6 204.6 204.5 204.4 204.4 204.3 204.2 204.1 204.1 204.0 203.9 203.8 203.7 203.6 203.5 203.4 203.3 203.2 203.1 203.0 202.9 202.8 202.7 202.6 202.4 202.3 202.2 202.1 201.9 201.8 201.7 201.6 201.4 201.3 201.2 201.0 200.9 200.8 200.6 200.5 200.3 200.2 200.1 199.9 199.8 199.7 199.5 199.4 199.2 199.1 199.0 198.8 198.7 198.6 198.4 198.3 198.2 198.1 197.9 197.8 197.7 197.6 197.4 197.3 197.2 197.1 197.0 196.9 196.8 196.7 196.6 196.5 196.4 196.3 196.2 196.1 196.0 195.9 195.9 195.8 195.7 195.6 195.6 195.5 195.5 195.4 195.3 195.3 195.3 195.2 195.2 195.1 195.1 195.1 195.1 195.0 195.0 195.0 195.0 195.0 ] avg-T=200.001936
itn=17020 [ 205.0 205.0 205.0 205.0 205.0 204.9 204.9 204.9 204.9 204.8 204.8 204.7 204.7 204.7 204.6 204.5 204.5 204.4 204.4 204.3 204.2 204.1 204.1 204.0 203.9 203.8 203.7 203.6 203.5 203.4 203.3 203.2 203.1 203.0 202.9 202.8 202.7 202.6 202.4 202.3 202.2 202.1 201.9 201.8 201.7 201.6 201.4 201.3 201.2 201.0 200.9 200.8 200.6 200.5 200.3 200.2 200.1 199.9 199.8 199.7 199.5 199.4 199.2 199.1 199.0 198.8 198.7 198.6 198.4 198.3 198.2 198.1 197.9 197.8 197.7 197.6 197.4 197.3 197.2 197.1 197.0 196.9 196.8 196.7 196.6 196.5 196.4 196.3 196.2 196.1 196.0 195.9 195.9 195.8 195.7 195.6 195.6 195.5 195.5 195.4 195.3 195.3 195.3 195.2 195.2 195.1 195.1 195.1 195.1 195.0 195.0 195.0 195.0 195.0 ] avg-T=200.001936
itn=18000 [ 203.4 203.4 203.4 203.4 203.4 203.4 203.4 203.4 203.4 203.3 203.3 203.3 203.2 203.2 203.2 203.1 203.1 203.1 203.0 203.0 202.9 202.9 202.8 202.7 202.7 202.6 202.6 202.5 202.4 202.4 202.3 202.2 202.2 202.1 202.0 201.9 201.8 201.8 201.7 201.6 201.5 201.4 201.3 201.3 201.2 201.1 201.0 200.9 200.8 200.7 200.6 200.5 200.4 200.3 200.2 200.1 200.0 200.0 199.9 199.8 199.7 199.6 199.5 199.4 199.3 199.2 199.1 199.0 198.9 198.8 198.8 198.7 198.6 198.5 198.4 198.3 198.2 198.2 198.1 198.0 197.9 197.8 197.8 197.7 197.6 197.6 197.5 197.4 197.4 197.3 197.3 197.2 197.1 197.1 197.0 197.0 197.0 196.9 196.9 196.8 196.8 196.8 196.7 196.7 196.7 196.7 196.6 196.6 196.6 196.6 196.6 196.6 196.6 196.6 ] avg-T=200.001936
itn=19200 [ 202.2 202.2 202.2 202.2 202.2 202.2 202.1 202.1 202.1 202.1 202.1 202.1 202.1 202.0 202.0 202.0 202.0 201.9 201.9 201.9 201.8 201.8 201.8 201.7 201.7 201.7 201.6 201.6 201.5 201.5 201.5 201.4 201.4 201.3 201.3 201.2 201.2 201.1 201.1 201.0 201.0 200.9 200.9 200.8 200.7 200.7 200.6 200.6 200.5 200.4 200.4 200.3 200.3 200.2 200.2 200.1 200.0 200.0 199.9 199.9 199.8 199.7 199.7 199.6 199.6 199.5 199.4 199.4 199.3 199.3 199.2 199.2 199.1 199.0 199.0 198.9 198.9 198.8 198.8 198.7 198.7 198.6 198.6 198.5 198.5 198.5 198.4 198.4 198.3 198.3 198.3 198.2 198.2 198.2 198.1 198.1 198.1 198.0 198.0 198.0 198.0 197.9 197.9 197.9 197.9 197.9 197.9 197.9 197.8 197.8 197.8 197.8 197.8 197.8 ] avg-T=200.001936
itn=19432 [ 202.0 202.0 202.0 202.0 202.0 202.0 202.0 202.0 201.9 201.9 201.9 201.9 201.9 201.9 201.8 201.8 201.8 201.8 201.7 201.7 201.7 201.7 201.6 201.6 201.6 201.5 201.5 201.5 201.4 201.4 201.3 201.3 201.3 201.2 201.2 201.1 201.1 201.0 201.0 200.9 200.9 200.8 200.8 200.7 200.7 200.6 200.6 200.5 200.5 200.4 200.4 200.3 200.2 200.2 200.1 200.1 200.0 200.0 199.9 199.9 199.8 199.8 199.7 199.6 199.6 199.5 199.5 199.4 199.4 199.3 199.3 199.2 199.2 199.1 199.1 199.0 199.0 198.9 198.9 198.8 198.8 198.8 198.7 198.7 198.6 198.6 198.6 198.5 198.5 198.4 198.4 198.4 198.3 198.3 198.3 198.3 198.2 198.2 198.2 198.2 198.1 198.1 198.1 198.1 198.1 198.1 198.0 198.0 198.0 198.0 198.0 198.0 198.0 198.0 ] avg-T=200.001936
itn=19433 [ 202.0 202.0 202.0 202.0 202.0 202.0 202.0 202.0 201.9 201.9 201.9 201.9 201.9 201.9 201.8 201.8 201.8 201.8 201.7 201.7 201.7 201.7 201.6 201.6 201.6 201.5 201.5 201.5 201.4 201.4 201.3 201.3 201.3 201.2 201.2 201.1 201.1 201.0 201.0 200.9 200.9 200.8 200.8 200.7 200.7 200.6 200.6 200.5 200.5 200.4 200.4 200.3 200.2 200.2 200.1 200.1 200.0 200.0 199.9 199.9 199.8 199.8 199.7 199.6 199.6 199.5 199.5 199.4 199.4 199.3 199.3 199.2 199.2 199.1 199.1 199.0 199.0 198.9 198.9 198.8 198.8 198.8 198.7 198.7 198.6 198.6 198.6 198.5 198.5 198.4 198.4 198.4 198.3 198.3 198.3 198.3 198.2 198.2 198.2 198.2 198.1 198.1 198.1 198.1 198.1 198.1 198.0 198.0 198.0 198.0 198.0 198.0 198.0 198.0 ] avg-T=200.001936

Steve G

unread,
Mar 26, 2022, 11:36:02 AM3/26/22
to
Richard Smith <nu...@void.com> writes:

> Hello all

hi

> Only posted once before, many years ago, so please be gentle with me!

at least someone still posts...

> How do you make a computer program output to a text buffer of your
> chosing? So that at the end of the program run you can save (C-x
> C-f).


This is from the elisp documentation :

To operate temporarily on another buffer, put the ‘set-buffer’ within
a ‘save-current-buffer’ form. Here, as an example, is a simplified
version of the command ‘append-to-buffer’:

(defun append-to-buffer (buffer start end)
"Append the text of the region to BUFFER."
(interactive "BAppend to buffer: \nr")
(let ((oldbuf (current-buffer)))
(save-current-buffer
(set-buffer (get-buffer-create buffer))
(insert-buffer-substring oldbuf start end))))

EOQ



> I use "C-u C-x C-e" frequently.
>
> But haven't found how to pick up a big output direct out like the
> example appended into a buffer.


Check out the elisp info pages. C-g i, F1, HELP; or
just type the following into the emacs minibuffer.

M-:
(info "(elisp)Writing to Files")

The (info "(elisp)") documentation is excellent and it should be built
into your emacs. C-h i for info or C-h ? for help.


> I've never studied this, and pick up "messages" in the "Message"
> buffer and copy and paste. Proper method would be good.

It would seem as though nobody does. The last time I went to college
they got rid of their system V for labtops and video conferencing.
The digital books in the library are now free for all the students to
read anywhere or anytime they want :)

You are very astute to notice the message buffer. Always remember `never
insert directly into the transaction log'.

As per proper method; more details would be needed. I'm just killing
some time and I love to program in lisp. so just shoo...

> I suspect this is a very common question. Could you point me in the
> right direction?

No it is not a common question. Most people want to customize emacs, not
understand it.

> By the way - I use emacs lisp for general programming because emacs is
> already there on the computer and it does absolutely fine for all my
> programming needs.

Tell me about it :) I am very behind in my python learning. The info
pages are never supplied with new programming languages, and no body
ever seems to use /usr/share/emacs/site-lisp/ for site specific stuff.

I have found that using the builtin info system greatly speeds my
productivity compared to the online documentation. As soon as I open the
web browser I feel like I am drowing in wave of useless eye candy. I
digress.

> It objects to a lot of recursion, which could run to several million
> recursions for a fine accurate solution (though is tail-recursive),
> but a looping expression is easily done and can do millions of loops
> readily.

If you want to get into lisp try slime with the lisp of your choice. You
can have the buffers sent to the common-lisp process through emacs.

> Also advantage emacs is the opportunity to inject the answer straight
> into the buffer / file with your notes.

I agree; the interactive nature of the software is truely distinguished.

Gene

unread,
Mar 26, 2022, 7:33:43 PM3/26/22
to

Gene

unread,
Mar 26, 2022, 7:49:43 PM3/26/22
to
On Saturday, May 23, 2020 at 12:21:10 PM UTC-4, Richard Smith wrote:
> Hello all
>
> Only posted once before, many years ago, so please be gentle with me!
>
> How do you make a computer program output to a text buffer of your
> choosing?

(insert <text to be inserted>)

^-- This is your friend. switch-to-buffer is worth looking into as well.

The assortment of `read' functions and `prin__' commands allow one to specify stdin, stdout, buffers, files and such ... if memory serves.

Though now one can do much with org-mode.
So one may embed the elisp code inside an org-mode file which also receives the output generated by the elisp code.

You've got options.

Gene

Gene

unread,
Mar 27, 2022, 8:49:00 PM3/27/22
to
On Saturday, May 23, 2020 at 12:21:10 PM UTC-4, Richard Smith wrote:
> Hello all
>
> Only posted once before, many years ago, so please be gentle with me!
>
> How do you make a computer program output to a text buffer of your
> chosing? So that at the end of the program run you can save (C-x
> C-f).
>
> I use "C-u C-x C-e" frequently.
>
> But haven't found how to pick up a big output direct out like the
> example appended into a buffer.
>
> I've never studied this, and pick up "messages" in the "Message"
> buffer and copy and paste. Proper method would be good.
>
> I suspect this is a very common question. Could you point me in the
> right direction?
>
> By the way - I use emacs lisp for general programming because emacs is
> already there on the computer and it does absolutely fine for all my
> programming needs.
> It objects to a lot of recursion, which could run to several million
> recursions for a fine accurate solution (though is tail-recursive),
> but a looping expression is easily done and can do millions of loops
> readily.
>
> Also advantage emacs is the opportunity to inject the answer straight
> into the buffer / file with your notes.
>
> Regards,
> Rich Smith

Given that most end-user `office' apps allow one to both import and export CSV and/or TSV files, you might want to consider using commas or tabs as delimiters when you output your computed data.
Data in this format can be used within emacs as well as gobs of desktop apps, smartphone apps, etc.

It's super smart to use a neutral format which allows you to work back and forth between an assortment of apps.

Gene

P.S. both simple emacs spreadsheet AND Org tables will allow you to format things in a more-readable way ... so you might want to experiment with either or both of them.

G

Richard Smith

unread,
May 24, 2022, 3:50:11 AM5/24/22
to
Hiya Steve, Gene

Thanks for ideas.
Sorry - I got what I needed to do done and moved on without being
grateful looking at further responses.

Since then, I've ended up with a suite of functions for doing beam
calculations. As is classic with lisp - it started at the bottom
doing the frequent repetitious lowest-level calculations and grew
upwards into all-in-one functions for specific cases. eg. a
simply-supported I-beam.

Bottom-up programming.
Creating your own language for expressing a class of problems /
challenges

Totally to be commended.
About computing as I do it.
I'm a welder, basic engineer and metallurgist, so when everythign is
running right with computing I don't otherwise think of it. I've been
working long hours welding in the last couple of years.

Gene

unread,
May 25, 2022, 1:09:46 AM5/25/22
to
On Tuesday, May 24, 2022 at 3:50:11 AM UTC-4, Richard Smith wrote:
> Hiya Steve, Gene

> Totally to be commended.
> About computing as I do it.
> I'm a welder, basic engineer and metallurgist, so when everythign is
> running right with computing I don't otherwise think of it. I've been
> working long hours welding in the last couple of years.

It seems that we have a few common features of our personal past.
Though I learned how to weld along the way, I've never done it professionally.
And to the extent that's I'd want to weld anything as if `permanent', I'd want an CNC angle grinder to UN-weld it.
Since my last welding course I've assembled things NOT out of metal via various ways BECAUSE value disassembly as much as assembly.

As for `applied science' I obtained an AAS in mech tech which required me to so beam calculations and introduced me to metallurgy.
But those degree requirements were posed and met BEFORE CAD software became available for PCs, and the `word processor' was yet to become available and mainstream.
BECAUSE there WERE Computer-Aided Design tools -- called programming languages -- all the tech programs at my college had a `computer apps' course in which one Designed and used their OWN apps, though regrettably in BASIC rather than in a functional language such as APL, Lisp, or scheme ... or even Forth as a thinly veiled programmable version of a stack-based reverse-polish notions calculators marketed by HP and coveted by engineers the world over.
Little did we know it, we were doing IA -- Intelligence Augmentation.
And when ready-made CAD apps and the word processor became available, MOST of my class mates had moved on to become professionals who were de-skilled as IA neophytes do to `the boss' requiring them to use off-the-shelf code -- proprietary stuff with the hood welded shut so thoroughly closed to empirical inquiry that as people obsessed with knowing how-to and how-things-work `under the hood' -- collect their pay checks, and get on with things.
That was in the early 80's
By the mid 80's the CAD manufactures selected `scheme' as the official language for pimping out CAD software ... for all the good it did.
Though AutoCAD had integrated David Betz's Xlisp into AutoCAD as AutoLisp, the Mech Tech students just 5 years behind me were befuddled by it, though they used magical incantations distributed in CAD magazines, without understanding them at more than a superficial level.
The prof in the mech tech program knew BASIC and introduced his students to the joys of AutoCAD, the CADkey, then whatever else appeared on the market as off-the-shelf products.
With never-the-twain-may-meet IA DIY coding of one's OWN algorithms, which our class had done using Statics and Strength of Materials as our domain of application manifesting among those capable of coding said apps in BASIC.
The chasm only widened as the years and decades when by.

Unlike my peers in that Mech Tech program, I went on to study computer science and electrical engineering tech.
When I entered the work world I had a background and know-how in software engineering.
But whose side was I on?
My IA comrades who once coded Statics and Strengths of materials ... but whom passively stood by as those skills were outsourced to CS weenies who didn't know jack shit about the apps they were coding ... or those self-same CS weenies?
I held both with contempt for not occupying the middle ground wherein those who knew their shit about a domain of application did not `code' and those who ended up gainfully employed doing `coding' didn't know jack shit about the domain of application.

Although Ivan Sutherland came up with propagation of constraints as a means of solving for unknowns on par with Simultaneous Equations as taught by the math weenies occupying slots teaching Algebra, THAT whole field -- mathematics -- has become as incalcitrant at the Catholic Priesthood which Marin Luther railed against for using Liturgical Latin.

Fast forward to Present.
Who CARES?

The smartphones are now more capable than the supercomputers of the 80s, and their users routinely fail the requirement to be at least 10% smarter than the equipment the= are operating.

What student of mech tech or welding is going to cultivate an attitude of Intelligence Augmentation sufficient to forgo the temptations of using off-the-shelf apps, even if they don't work and play well together?

Yes, Emacs can be used to edit AutoLisp and visualisp, as well as scheme.
Who is left to CARE?

I can transcribe Algebra notation into elisp, but who cares?

People don't seem concerned with augmenting their personal intelligence via algorithms AT ALL, let alone via lisp.

I'm impressed that you've implementing welding formulae in elisp notation, Richard.

I'm disappointed that more are interested in AI -- as some magical whizzbang tech which will SOME DAY benefit them some day in some way -- than in IA using, say, lisp syntax

Its seems that you took matters into your own hands and came up with Intelligence Augmentation suitable to your purposes!

Cheers!

0 new messages