Archive for the ‘emacs’ Category

org2Blog – Such fun

2020-01-08

My earlier post today ran into to a couple of issues within the example code blocks. Dr Charl Botha blog post gave me hope, and then I found my org2blog package was somewhat out of date. Having updated to v1.1.1 and set `(setq org2blog/wp-use-sourcecode-shortcode nil)` as per the Doc’s suggestion, lets see how this fares…

Listing 1.Name: org_example_src_check_for_org2Blog.

true && cat <<EOF >&1
That's another fine mess averted
EOF

I have to say the org2blog documentation has much improved since I last looked. Also available via M-x org2Blog-readme; very neat.

org2blog git page modified

2019-05-26

By the the power of github, I amended the org2blog usage to include the magical key sequence C-c M-p d to publish your emacs buffer to your blog. Was glad to see that githup has org-mode as an editing mode. Though I see it didn’t understand underscore. [Hmm, seems underscore is not liked here either!]

I’m trying to get myself back into blogging if you hadn’t guessed.

Emacs Tramp failing to load files from Solaris

2019-05-25


While using Emacs (Emacs-app from MacPorts) on macOS to edit files on Solaris system via Tramp I’ve been finding it was unable to edit from some hosts. To open a file using tramp the filename is entered as /protocol:[user@]hostname[#port]:pathname. For example, /scp:solaris:.profile. Tramp does not simply scp the file over. It connects to the remote system using ssh and carries out a number of tests. Emacs hung at this point when access Solaris 11.4 hosts, interuptable with Control-G. This was from MacOS version 10.13/10.14.

Setting Tramp verbosity to 10 (setq tramp-verbose 10) it appeared that Tramp was waiting for output from the remote host.

On the Solaris host I was using truss to watch the exec calls made by the bash shell that was started by tramp. The output of which suggested it had not received the command sent by tramp.

Aware that Solaris 11.4 uses OpenSSH rather than SunSSH I wondered if it was perhaps related to that. I spoke to my colleague Darren Moffat, who reminded me that OpenSSH has multiplexing; which Tramp can use. A quick test to 11.3sru35 with ssh still set to the default SunSSH version, showed the fault still occurred. By process of elimination I found the fault came about in Solaris 11.3sru17, where bash was updated from 4.1.17 to 4.4.11…

I tried switching shells:

(add-to-list 'tramp-connection-properties
             (list ".*" "remote-shell" "/usr/bin/ksh"))

but that I had no effect, it still hung.

Edit: 2020-04-23 Today I found that I do need to specify use of ksh as /bin/sh would exit following SIGSEGV while sending shell function tramp_perl_file_attributes().  Subject for another post.

Darren did suggest trussing the sshd process rather than the shell, with privileges elevated truss of the sshd process showed the tramp command had been received and sent to the shell process….

At this point I was about to expand the truss to show more information other that read,write and exec calls, when I noticed the locale. On the Mac LANG and LC_CTYPE is set to en_GB.UTF-8. Tramp was setting LC_CTYPE on the remote host too, not via ssh – it actually set it as part of the initialization. As I had noticed issues while ssh’ed in, I set the locale:

(add-to-list 'tramp-connection-properties
             (list ".*" "locale" "LC_ALL=C"))

Cleaned up all open connections (tramp-cleanup-all-connections) and hey-presto I’m back in operation.

Somewhat annoyingly this is mentioned on Emacs Wiki, I shall go and add my workaround.

Now obviously it shouldn’t matter what the locale is, it should have worked, but that is for another day.

Emacs 26.2 Tramp 2.3.5.26.2 Solaris 11.3sru17

Using org2blog, first attempt.

2015-10-15

Testing, testing, 123.

Got past the initial 301 error from wordpress, presume either the redirect URL was wrong or the xml-rpc emacs package didn’t recognize it, once using ‘https’ rather than ‘http’ for the xml-rpc login (thanks punchagan and google for that).

So – how does this look?

org-mode is an emacs simple text formatting with many powerful features. I’m not going to list them or try them here now. Just want to get a feel for it. Some examples

heading 1, with a list partial list [33%]

  • [X] item 1
  • [ ] item 2
    • item 2 With sub
  • [ ] item 3

sub heading 2, lets have a table

table example
Not one to eat off of silly.

hmm, I like lines…

table 2 line under heading
Hows that?