texts: org-ref drag & drop PDF error: "Invalid search bound (wrong side of point)"

texts:
I drag and drop the pdf of this paper into a .bib file... doi:10.1136/bmj.39001.657755.BE

This error appears in the messages buffer:

[yas] Prepared just-in-time loading of snippets successfully.
For information about GNU Emacs and the GNU system, type C-h C-a.
looking-back: Invalid search bound (wrong side of point)

Backtrace:
Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
  re-search-backward("\\(?:\n\n\\)\\=" 3 t)
  looking-back("\n\n" 3)
  doi-utils-add-bibtex-entry-from-doi("10.1136/bmj.39001.657755.BE" "/Users/williamobrien/test.bib")
  org-ref-pdf-dnd-protocol("file:/Users/williamobrien/bibliography/bibtex-pdfs/hallan06_screen_strat_chron_kidney_diseas_gener_popul.pdf" private)
  dnd-handle-one-url(#<window 3 on test.bib> private "file:/Users/williamobrien/bibliography/bibtex-pdfs/hallan06_screen_strat_chron_kidney_diseas_gener_popul.pdf")
  ns-drag-n-drop((drag-n-drop (#<window 3 on test.bib> 2 (215 . 239) 0 nil 2 (30 . 1) nil (215 . 225) (7 . 14)) (file "/Users/williamobrien/bibliography/bibtex-pdfs/hallan06_screen_strat_chron_kidney_diseas_gener_popul.pdf")))
  funcall-interactively(ns-drag-n-drop (drag-n-drop (#<window 3 on test.bib> 2 (215 . 239) 0 nil 2 (30 . 1) nil (215 . 225) (7 . 14)) (file "/Users/williamobrien/bibliography/bibtex-pdfs/hallan06_screen_strat_chron_kidney_diseas_gener_popul.pdf")))
  call-interactively(ns-drag-n-drop nil nil)
  command-execute(ns-drag-n-drop)

Emacs version 25.1.1 and org-ref installed from melpa today.

Does anyone else get the same error for this journal article?


texts:
I would like w3m in emacs (in a terminal) to show me pictures.

Showing pictures in emacs gui works:

Showing pictures in the terminal without emacs works:

But in emacs w3m running in a terminal, no images are shown:

Pressing T doesn't help, instead I get the message "Can't display images in this environment".

But since emacs and termite are clearly able to show images from w3m, why not at the same time?

Additional information: I am using x86_64 Arch Linux 4.7 with GNU Emacs 24.5.1 and w3m 0.5.3 and the w3m package 20160727.837 in emacs


texts: Does some command exist, which goes to the next file of the current directory?

texts:
I'm looking for a command inside Emacs.

For example, you are currently in a directory.
In the directory there are 2 files: foo.txt and bar.txt.

I have foo.txt opened in Emacs and is being displayed in a buffer. Then I would like to go to the next file of the current directory of the buffer, so open the bar.txt.

I know there is a Helm source for displaying the another files of the current directory, but I would like to make a keybinding for it, to scroll forth and back between the files in the directory. Dired gave me no suitable commands.

Anyone knows a suitable command?


texts: One of the keys Emacs refers to is the key LFD. For example, calc binds that key to calc-over. What key is this?


texts: Arithmetics in a regex in a lisp function

texts:
I want to replace all hard column widths in several LaTeX-documents, e.g. replace {90mm} by {0.75\textwidth}. I already found out that you can use \, and #1 to so arithmetics on captured groups, like e.g. here. But I can't get it to work in a lisp function. I tried several things to no avail, and now would like if this is possible at all, and if yes, how.

Here's something that I came up with that doesn't work:

(defun colum-width-relative ()
  ""
  (interactive)
  (beginning-of-buffer)
  (save-excursion
    (query-replace-regexp
     "{\\([0-9]+\\)mm}"
     (concat "{0." \,(/ (* #1 100) 120) "\\\\textwidth}"))))


texts: Is there a way of splitting a src block into several blocks while keeping them together with noweb reference syntax and editing them using org-edit-special in such a way that would take into account all the noweb referenced blocks?


texts: Displaying information for string under point

texts:
At work, I very commonly have to look up bits of information about strings in my code. For instance, we might use an incomprehensible ID, "a587fg", to refer to a customer with a perfectly comprehensible name, "FooCorp". It's fairly easy to define a function and bind it to a key mapping to look up a thing under point -- but what I'd much prefer is an ElDoc-style "here's some info about thing-under-point in the echo area, automatically" situation.

My reflex was to go to ElDoc itself, but I can't get it to work and I've no idea why. My best theory so far is that ElDoc only triggers on symbols -- which, of course, an arbitrary string isn't, and probably shouldn't be.

So: maybe I'm wiring up ElDoc wrong? Maybe there's a better way to do info-of-string-at-point? Who can help me understand how to get this working?

For reference, here's how I'm wiring things up:

(defun my-eldoc-function ()
  "Get info about string at point"
  (let (the-str)
    (if (setq the-str (thing-at-point 'string t))
        (my-str-doc-fun the-str) ;; Returns a string or nil
      nil)))

(set (make-local-variable 'eldoc-documentation-function)
     'my-eldoc-function)


texts: How to prettify symbols inside comments?

texts:
I'm using prettify-symbol mode together with Pragmata Pro.el.
Ligatures work perfectly fine in the source code but for some reason with comments they don't. I think I'm missing something since it's not the first time I've fought with ligatures in Emacs.


texts: org capture: Store new file name or use an existing file name as a variable

texts:
I'm looking for a way to use a fuzzy finder menu to store a new file name or select an existing file name as ${title} or %ˆ{Name} string variable.
I use the zettelkasten system and my workflow consists of capturing snippets of information and sorting them through indexes.
For example, A book I'm reading is the index file while every chapter I take notes on is a snippet file. Here's how it looks https://imgur.com/U4zdYsL. Currently, I use org-roam with org-roam-capture.
Issue: I want a menu similar to org-roam-find-file where all of my previously created notes are shown. Org-roam-capture only allows me to store new files as ${slug} & ${title} but upon selecting an existing file, it opens it rather than create a new file with the {title} variable filled out.
I saw an answer here but it isn't explicit. What function should I use? I'm new to elisp.
Workflow: Search my files by typing the name. If there are no options then save it as ${choose index} variable and if it exists then select the file and store it as ${choose index} variable, too. Doesn't have to be ${choose index}, I just need it to be auto-filled.
Here's how my org-roam-capture-template looks.
  (setq org-roam-capture-templates
   '(
      ("l" "[Note] Literature Snippet" plain (function org-roam--capture-get-point)
       "%?"
       :file-name "${choose index}_snippet-%<%Y%m%d%H%M%S>"
       :head "#+TITLE: Snippet: %^{snippet name}
              Source: [[file:_daily/${choose index}.org][${choose index}-index]]\n"
       :unnarrowed t)
    ))

${choose index} is the variable where I store the existing file or new file name from the menu while %^{snippet name} simply prompts for the title of the snippet.


texts: Why doesn't C-c C-c compile my LaTeX document? Did I set up AUCTeX correctly?

texts:
This may seem like an odd question but I believe there absolutely should be a standard or most common way to use LaTeX on emacs, and that this community would benefit from owning a complete answer to this question, so here goes.

This is my first Google hit for "emacs latex mac", which seems to imply AucTeX is the way to go.

AucTex lives here and it is covered in the GNU wiki here.

I'm trying installing it now but I'm not sure how out-of-the-box it is. The wiki says:

  C-c C-c to run LaTeX over your document, then, once it has compiled correctly, C-c C-c again to view it, or if it failed to compile correctly, C-c ` to see the errors.

But C-c C-c doesn't do this (it brings up a prompt).


texts: How do I edit code in REPL after saving it in Emacs?

texts: Alright I apologize if this has been asked, but I cannot seem to find this problem through searching. I am trying to figure out how to work on code in Emacs and when I come back open it again to edit the code. I was working with Emacs in the REPL learning Common Lisp and I used the "save as" feature and saved my work. I come to it this morning and try to open it to finish up on it and when I load the file it opens either as read only or it "kills" the REPL and doesn't let me use the functions that I coded originally. When the file is loaded I can't compile it to use in the REPL and it seems to not want to work in the REPL when I try to copy.. I am new to Emacs and I am needing some help figuring out what I did wrong so I don't do this again. Til now I have only coded a few lines and just been starting from scratch and copying what is loaded in the file and completing my exercises, but that limits productivity. I am spending more time trying to figure out how to use Emacs than I am learning Common Lisp. I am not sure what I did wrong, but if there are any Emacs gurus out there that could help me out I would greatly appreciate it! Thank you in advance!


texts: Helm - select with Tab instead of Enter?

texts:
In Visual Studio and Intellij I can press Tab to select the highlighted auto-completion.

In Helm: Is there a way to give Tab the same behavior as Return?


texts: How to store an eshell alias in `init.el`?

texts:
I like to keep my configuration as self-contained as possible, and I'm wondering whether there's a way to manage eshell aliases in my .emacs file. Is it possible to set up aliases with a function call kept in my .emacs rather than a separate file in .emacs.d/eshell/aliases?

The problem I am ultimately trying to solve is to get ff when entered in command position in eshell to reliably behave identically to find-file. I am assuming that the easiest, most direct way to do this is an eshell alias.

The alias below, with single quotes, exactly as written, does the trick and behaves like find-file does. I'm just trying to manage my aliases in the same place as the rest of my customization.

alias ff 'find-file $1'

Here are some attempted solutions to the problem that don't work and the steps to reproduce. The fact that they don't Just Work suggests to me that some work is needed to "wire up" a function so that it's usable from eshell.

Non-Solution 1, eshell/ff function

$ emacs -q -no-site-file
within emacs, C-x b *scratch* C-m
write wrapper function in scratch buffer.

(defun eshell/ff (&rest args)
  (apply #'find-file args))

C-x h M-x eval-region C-m then C-g to deselect
C-h f eshell/ff to verify that the function exists.
M-x eshell C-m
within eshell, type find-file /etc/hosts and visit the buffer. Then go back to eshell
within eshell, type ff /etc/hosts. The error message below shows us that eshell found our definition, but is somehow treating it differently than find-file.

~ $ ff /etc/hosts
Wrong number of arguments: (1 . 2), 0

Non-Solution 2 (defalias 'ff 'find-file)

$ emacs -q -no-site-file
within emacs, C-x b *scratch* C-m
write wrapper function in scratch buffer.

(defalias 'ff 'find-file)

C-x h M-x eval-region C-m then C-g to deselect
C-h f eshell/ff to verify that the function exists.
M-x eshell C-m
within eshell, type find-file /etc/hosts as before to verify that find-file still works
within eshell, type ff /etc/hosts. The error message is the same as in Non-Solution 1.


texts: I do "C-h f" a lot for emacs lisp functions. I prefer to have the window displaying the Help buffer selected (right after C-h f) and then press "q" when im done to close the window. Is there a way to achive this?


texts: How to determine if a buffer will respond to outline-mode commands

texts:
I'm hacking together an extension which will display a sidebar with an outline of whatever document you're working on. It was initially written to support writing in markdown-mode, but the technique I'm using (which might be bone-headed) relies on using outline-mode commands like outline-hide-body. As such, the extension should, I think, work for any mode for which these commands have an effect.

So my question is: is there a way to determine if outline-mode commands - and specifically outline-hide-body - are properly defined for a given buffer?

Right now I just rely on a list of major-modes (e.g. org-mode, markdown-mode) for which I know these commands work. But this seems like a relatively weak approach since it ignores e.g. outline-minor-mode which I should probably check for as well. So before I go down the path of trying to enumerate the the major and minor modes I can work with, I thought I should see if there's a better way.


texts: How to prioritize key bindings between modes?

texts:
I have two modes that bind a key. How can I choose which one should get to do its thing?

I'm asking generally but currently the situation is that when I'm in a certain mode, I want to use its bindings (which are currently shadowed by another mode).

I even tried to add a hook that local-set-keys at the end of my init file but that doesn't work, it gets shadowed too.


texts: Org Mode exclude subtree from agenda views

texts:
I'd like to tag or else mark a subtree as on the "backburner" and exclude the subtree (and its children) from all agenda views, e.g. agenda, to do, match list, etc.

Basically this would replicate the functionality of the :ARCHIVE: tag, except I already use that tag for archiving, and it appears that org-archive-tag does not accept multiple strings.

I've also tried the following:

#+TODO: TODO | DONE
#+TODO: WAIT BURN | CANC

This allows me to exclude a single subtree, but not its children, so it's not particularly useful for sending a whole project to the backburner.

Any ideas or alternate workflows I might try for putting projects on the backburner?


texts: How to match emacs column count to gofmt column count?

texts:
I am writing Go code but the error messages do not agree with Emacs' column count.

Is there an off-the-shelf solution for this? I'm wondering about a minor mode or even a few lines for my .emacs file. I've tried searching but haven't found anything. I can't be the only one who has come across this and I'm sure it's not just Go that has this issue.
Background

My tab-width is set to 4.
My Emacs counts \t (tab) as four columns; go and gofmt counts \t as one column.
Emacs starts counting columns from 0; gofmt starts counting from 1. (I can solve this)
gofmt, which runs whenever I save a Go file, puts tabs instead of spaces at the start of each line. (I like this standardisation.)
I'm running Emacs 24.5. (This is the latest version available on the Long Term Support Linux distribution I'm using.)

The main problem comes from the discrepancy between the tab counts. The secondary issue is the column count in Emacs starting from 0 instead of 1.


texts: Org-babel variables argument reading twice

texts:
I am executing a src block on a table that is determined by a prompt. A minimal example:

#+NAME: a-table
| Value  |

#+begin_src emacs-lisp :var (princ (format "table=a-table" (read-string "Select: ")))
table
#+end_src

#+RESULTS:
| Value |

All is fine except that read-string is executed twice and takes the second prompts value. In reality I'm using helm to select from a list of tables and the helm prompt also appears twice.

Moving :var to a header-args property changes nothing.

Ideas?

Org mode version 9.0.3 and GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570


texts: org2blog/xml-rpc posting fails with "403"

texts:
I've been successfully using org2blog for awhile, but it has stopped working in recent days. When I try to log in from emacs, org2blog asks my password as always. I provide it, and the process fails with

xml-rpc-request: Error during request: 403

I can still log in to my account from my web browser, so it doesn't appear to be on that end. Here's my init.el lines for org2blog:

;; * org2blog
(require 'org2blog-autoloads)
(setq org2blog/wp-blog-alist
   '(("stevenarntson.com"
      :url "http://stevenarntson.com/xmlrpc.php"
      :username "stevenarntson"
      :tags-as-categories nil)))

What is wrong here, or, alternatively, what next step should I take to diagnose this?

emacs 24.5.1

org 8.3.2

org2blog .9.2

xml-rpc 1.6.11


texts: Is there a way to convert an array of bytes into a UTF-8 string?

texts:
There are now some files which contain raw bytes which are valid UTF-8 characters, e.g. a line of the file could be '@\u0915\u0941\u091b@ \u092c\u093f\u0902\u0926\u0941 \u0938\u095e\u0947\u0926 \u0939\u0948\u0902'

I want to restore them to their original UTF-8 strings and save the files.

Is there a way to do it in Emacs?


texts: When I launch an ansi-term in a remote (TRAMP) buffer, I'd like the resulting shell to reflect the current default-directory. That is, I'd like ansi-term to give me a remote shell, so I can do things in the directory of the current file.


texts: Yasnippet doesn't work when tab-always-indent set to true

texts:
It annoys, when autocompletion & indentation both gets called on TAB press. So, i configured to use TAB key only for indentation as,

(setq tab-always-indent t)

Now, when i enable yas-minor-mode to place code snippets, it doesn't work since i have bound TAB key only for indentation. Is there any other key binding (or) yasnippet function that can i use/call to get this feature?


texts: How can I make the cursor change to block in overwrite mode?

texts:
I got something like that:

(global-set-key [insert] (lambda () (interactive) (overwrite-mode) (setq cursor-type 't)))

But I don't know how to do it so that when you exit the insert mode (when you press insert again) it becomes a bar again.

(setq-default cursor-type 'bar)


texts: Can a theme set faces normally provided by another package?

texts:
I want to produce a custom theme. I understand how to set built-in faces, like font-lock-nnn ones, modeline, etc.

I wonder if I can provide colors for faces that are defined by other packages, e.g. by magit, or by js2. (Inheritance helps but does not suffice.)

I suppose that a theme file can just define a function, and I could invoke it depending on presence of certain faces / variables some time later, but it looks like a hack, and won't work with normal customizations done via customize-group.


texts: org-element--cache-sync is needlessly called with setting initial-major-mode to org

texts:
In my case mu4e compose mode, everytime I got the error below:

  Error running timer `org-element--cache-sync': (wrong-type-argument hash-table-p nil)

This simptom is already subscribed as bug, but unresolved.
https://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg00947.html

It seems that (setq initial-major-mode 'org-mode) makes this happen.
Are there any good way to get rid of this timer error?


texts: Convert between numbered and unordered lists in org-mode

texts: Is there a function to convert between numbered and unordered lists in org-mode? The lists may or may not be nested.


texts: Keybinding for adding a new heading under a list item in org-mode

texts:
Lets say you are working in an org-mode structure like this:

* First level heading…
** Second level heading
*** Third level heading
- list item one
- list item two

After list item two you want to insert a new third level heading instead of another list item. Of course you can type Return and 3 times * yet I wonder if there is a command with a keybinding to do that.


texts: How to edit a documents outline in pdf-tools?

texts: By pressing o you can open the outline for the pdf document. Is there any way you can also add new sections with the corresponding pages to this outline?


texts: Robe mode: how to automatically require all submodules of the project?

texts:
After some fight, I was able to get some code completion and navigation from robe. Specifically, in the *pry* buffer I modified $LOAD_PATH to point at my project's source directories. However, now in order to get code navigation and completion for submodules I need to require all of them one by one... this seems very strange and, I hope, shouldn't be necessary...

So, what is the right way to make robe automatically discover all the submodules of my project?


texts: Emacs hangs/freezes if vpn connection is lost

texts: Every so often when Emacs is open and I edit some file via tramp and an established vpn connection and this connection is terminated and then reestablished, I cannot get Emacs to continue working. All that helps is restarting the client. Is this a common problem and/or is there a solution to it?


texts: How to get completion to ignore filename extensions

texts:
It's possible to ask completion to not suggest files with particular file extensions, by:

(setq completion-ignored-extensions
      (append completion-ignored-extensions
              (quote
               (".o" ".aux"))))

However, I'm not able to determine how to pattern-match on regular expressions before the "." and not just after it. For example, I don't want files that end with "_flymake.hs" to be suggested by completion modes. How could I accomplish this?


texts: Debugging huge memory allocation occurring before identified problematic function

texts:
I identified a particular situation which causes emacs allocates infinitely memory (and then freezes my PC).

To be specific, I have an external link [[file:article.djvu::5][problematic djvu file]] in an org-mode buffer. Calling M-x org-html-export-to-html freezes my PC.

The file must be a .djvu and the ::5 in the link is necessary, otherwise org-html-export-to-html works as expected. I also tried to only load relevant libraries (in my view) such as org-mode, pdf-tools and org-pdftools, but no freeze occurred. So I'm debugging with my full configuration.

Now, as I know that org-html-export-to-html causes the issue, I use M-x debug-on-entry to that function. However, the freeze occurs before the breakpoint reached.

Since the freeze occurred between calling M-x org-html-export-to-html and the entry to it, I don't know how to track this issue step-by-step.

It's possible to use edebug to start debugging as soon as I press M-x org-html-export-to-html? Since the issue is very specific, I'm looking for help on the debug process but not the issue itself.

UPDATE:

I got some progress on the issue. Lately, I've tried to M-x edebug-on-entry to counsel-M-x but it doesn't work. I disabled ivy and M-x debug-on-entry to execute-extended-command (a.k.a M-x). What happens now is that in the below backtrace, as soon as I pressed d (step through), the debugger doesn't step forward
and starting allocate infinitely memory.

Debugger entered--entering a function:
* command-execute(org-html-export-to-html record)
* #f(compiled-function (prefixarg &optional command-name typed) "Read a command name, then read the arguments and call the command.\nTo pass a prefix argument to the command you are\ninvoking, give a prefix argument to `execute-extended-command'." (interactive #f(compiled-function () #<bytecode 0x20c5849>)) #<bytecode 0x1cb743>)(nil "org-html-export-to-html" "org-html-ex-to-html")
* apply(#f(compiled-function (prefixarg &optional command-name typed) "Read a command name, then read the arguments and call the command.\nTo pass a prefix argument to the command you are\ninvoking, give a prefix argument to `execute-extended-command'." (interactive #f(compiled-function () #<bytecode 0x2151b59>)) #<bytecode 0x1cb743>) (nil "org-html-export-to-html" "org-html-ex-to-html"))
* execute-extended-command(nil "org-html-export-to-html" "org-html-ex-to-html")
  funcall-interactively(execute-extended-command nil "org-html-export-to-html" "org-html-ex-to-html")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)


texts:
I am learning about the kivy library for python. I have a test code which i run with C-u C-c C-c after having the python interpreter fired up with C-p. It runs fine the first time and the window opens, but trying to run it a second time makes nothing happen; the window doesn't show, only in the minibuffer below i see Sent: import kivy.

import kivy
kivy.require(kivy.__version__)
from kivy.app import App
from kivy.uix.label import Label

class MyApp(App):
        def build(self):
                return Label(text = "Guido Van Rossum", font_size = 90)

def main():
        MyApp().run()

if __name__ == "__main__":
        main()

Does anyone have experience with writing kivy using emacs, or can any one help?

Edit

This is what i get in the terminal the second time i run the code:

>>> [INFO              ] [Base        ] Start application main loop
[ERROR             ] [Base        ] No event listeners have been created
[ERROR             ] [Base        ] Application will leave


texts: How to check if a vector includes a value

texts:
When I want to know whether a list includes a value, I can use member function.

(member "a" '("a" "ā" "á" "ǎ" "à"))

Is there similar way to check if a vector includes a value?

(member "a" ["a" "ā" "á" "ǎ" "à"])
;=> nil


texts: How to stop ido-find-file/ido-switch-buffer prioritising the current buffer/file?

texts: For example, if I have a Test.cpp and a Test.h and one of them is open, ido-find-file will often suggest the already-open one first if I type "Test". Likewise when both are open and the current buffer contains one of them. It does not happen all the time, but frustratingly often. I never want to switch to/open the file I already have open. Is there any way to prevent this?


texts: How can I determine if a file is compressed from Elisp?

texts:
I know that I can use the file command to determine this, but I'd like a cross-platform solution using elisp only (or as few subprocesses as possible).  I have the compressed data in a variable called response; you can use the following shell command to get a sample of the data I'm trying to profile:

curl --silent "http://api.stackexchange.com/2.2/filter/create"

Piping the above through gunzip will give a readable result.  The problem is that my mechanism for retrieving the information has different behavior when it is run locally and when it is run on Travis.

Unfortunately, the Content-Encoding header lies.


texts: How to install sage-shell-mode with Emacs 25.1?

texts:
I would like to install sage-shell-mode. Now I read the README, and it indicated that with MELPA added to my package archive list I should be able to install sage-shell-mode with (after pressing M+x, of course) package-install sage-shell-mode. But this failed for me (i.e., sage-shell-mode was not found). Here is my ~/.emacs file, most notably this is how I enabled my package archives:

(package-initialize)
...
(add-to-list 'package-archives  (quote
(("gnu" . "http://elpa.gnu.org/packages/")
    ("melpa" . "http://melpa.org/packages/")
    ("marmalade" . "https://marmalade-repo.org/packages/")
    ("melpa-stable" . "http://stable.melpa.org/packages/")
    )))

Now I'm wondering if I made a mistake or whether sage-shell-mode is for whatever reason incompatible with Emacs 25.1. I have also run package-refresh-contents too, since I last updated my ~/.emacs file.


texts: How to have Emacs treat left Ctrl as Hyper?

texts:
I never use the left control key, so I'd like to rebind it as Hyper, but ONLY inside Emacs. Is there a way to do this?

EDIT: I'm running Emacs on a linux system.


texts: Changing how argument lists are indented in JavaScript

texts:
Right now, my argument lists are indented by js-mode like this:

some_long_function_name( one_argument,
                         another_argument );

How can I get them to look like this:

some_long_function_name( one_argument,
    another_argument );

(My c-basic-offset is already set to 4.)


texts: flyspell's highlight cleared after a "save word" action

texts: After running flyspell-buffer, all misspelled words are highlighted. However, after saving a word, all of the highlighting is gone. How can I avoid that? My flyspell-persistent-highlight is set t.


texts: Match any character in a regexp (e.g. `string-match`)

texts: In perl when matching multi-line strings you can add the s modifier /.../s that will change the semantics of . to match also newline. Is there something similar for string-match? Or is there a workaround?


texts:
Suppose I set two idle timers

(run-with-idle-timer 3 nil #'function1)
(run-with-idle-timer 3 nil #'function2)

What is the effect?  After roughly 3 seconds will emacs run function1 and then wait 3 further seconds, or will there be no second delay before running function2?

I have browsed through the timer.el code and could not see what action to expect.

Update/Conclusion

Thanks to phils' answer I tried evaluating

(run-with-idle-timer 2 nil #'message "Function 1")
(run-with-idle-timer 3 nil #'message "Function 2")
(run-with-idle-timer 3 nil #'message "Function 3")
(run-with-idle-timer 4 nil #'message "Function 4")

in the *scratch* buffer and consistently get

Function 1
Function 3
Function 2
Function 4

printed in the *Messages* buffer after 4 seconds idle time, demonstrating exactly the behaviour he describes.


texts: how to jump directly to an org-headline?

texts: If I'm in an org file, I want a command that narrows a candidate list, in ivy/helm style, comprised of all org headlines in the file and lets me choose the headline, through fuzzy searching, to which I want to jump to. Is there a way to do that?


texts: How to move to the end/beginning of the window/screen line?

texts:
For example, I got a small window, a long whole line is split into multiple lines, not actually split, but with one arrow at the end of each line of the window, if I use C-e or End key, this will move end point to the end of this actual line.

(setq truncate-lines nil)is set in my init.el, how can I move my point to the end of the window/screen line?


texts: Customizing org-latex-title-command to edit title page

texts:
I would like to know how to go about editing and understanding org-latex-title-command. So far it is set to \maketitle but the documentation just has this:

   The command used to insert the title just after \begin{document}. Hide

   This format string may contain these elements:

     %a for AUTHOR keyword
     %t for TITLE keyword
     %s for SUBTITLE keyword
     %k for KEYWORDS line
     %d for DESCRIPTION line
     %c for CREATOR line
     %l for Language keyword
     %L for capitalized language keyword
     %D for DATE keyword

   If you need to use a "%" character, you need to escape it
   like that: "%%".

What would I need to do so that I can at least make my \title font, defined in org keyword #+TITLE:, bigger than its current default settings. For example, this latex wiki has as its first example:

\documentclass{article}% use option titlepage to get the title on a page of its own.
\usepackage{blindtext}
\title{The Triangulation of Titling Data in Non-Linear Gaussian Fashion via $\rho$ Series\thanks{No procrastination}}
\date{2017\\ December}
\author{John Doe\\ Magic Department\thanks{I am no longer a member of this department}, Richard Miles University
\and Richard Row, \LaTeX\ Academy}
\begin{document}
\maketitle
\section{Introduction}
\blindtext
\end{document}

I understand that org-latex-title-command will be inserted right after\begin{document}, but how do I edit this variable with its format string elements? I know that +TITLE: mytitle inserts \title{mytitle} and that \maketitle makes the title appear in the latex document. However, the latex wiki formats the title before it calls \maketitle. Then, how should I accomplish what is in the example by accessing the org-latex-title-command? Ideally, I would just like to make the title bigger without affecting org-latex-title-command. Examples would help.


texts: Emacs + imaxima: "Symbol's function definition is void: defun*" [solved]

texts:
I have maxima 5.44.0 installed on my machine (Manjaro Linux) and it runs fine in a shell, and in Emacs 27.1 when I launch M-x maxima.
I've added
(add-to-list 'load-path "/usr/share/emacs/site-lisp/maxima/")
(autoload 'maxima-mode "maxima" "Maxima mode" t)
(autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t)
(autoload 'maxima "maxima" "Maxima interaction" t)
(autoload 'imath-mode "imath" "Imath mode for math formula input" t)
(setq imaxima-use-maxima-mode-flag t)
(add-to-list 'auto-mode-alist '("\\.ma[cx]\\'" . maxima-mode))

to my .emacs file.
But when in Emacs I launch M-x imaxima I get the error message "Symbol's function definition is void: defun*"
Has someone encountered this problem and has an example of a working configuration?
EDIT
My imaxima.el and imath.el files call defun*, which was defined in cl.el, but Emacs 27.1 has replaced cl.el with cl-lib.el, which replaces defun* with cl-defun. The updated *.el files are
imath.el and imaxima.el
Now I can start imaxima, I get a "Latex error", but that's another matter :)


texts:
I can set below variable to enable horizontal split window:

(setq split-height-threshold nil)
(setq split-width-threshold 160)

But currently, it will split 1:1, but I wish it split with 1:2, the upper window height is 1/3 and the bottom window height is 2/3.


texts:
I am Emacs and org-mode noob and using MS Windows 10. I would like to add a folder containing all org files to my org-agenda-files in my .emacs.

Location of my .emacs file:
c:/Users/Guest User/AppData/Roaming/
Location of dropbox folder contaning all .org files:
C:\Users\Guest User\Dropbox\workEMACS
Location of Dropbox application:
c:/Users/Guest User/AppData/Roaming/Dropbox

Specifically, I don't know what to add in the directory path
(setq org-agenda-files '("~/WhatToAddHere"))

P.S. ELI5


texts: Calling a macro from a macro with a variable number of arguments

texts:
Say there is a defmacro defined like this:

(defmacro do-something (foo &optional bar)
  (...))

And then there is another one that calls it:

(defmacro something-else (wat baz &optional bar)
  (let ((foo (concat wat baz)))
    (do-something ...)))

What is the best practice for calling do-something from within
something-else with the let variable foo, and bar only if it
exists as an argument passed into something-else?

I know you could conditionally check the presence of bar like so:

    (if bar
        (do-something foo bar)
      (do-something foo))

Ideally I'm looking for some pattern where I can prepare a list of
argument variables and call do-something once, with something like
(apply) for macros, where a list variable can be turned into a
variable series of consecutive arguments. Or maybe I'm just thinking
about this in the wrong manner?


texts: wanderlust: force expunge on all IMAP folders?

texts:
I'm using wanderlust under emacs 25.x.

I know that wanderlust properly expunges messages on the IMAP server when I delete them.

However, I have other IMAP clients (for example, the one I use on my Android device) which don't seem to properly expunge deleted messages on the same IMAP server.

Is there a way I can add some functionality to wanderlust so that when I invoke wl-folder-check-all or some similar function, it will perform an expunge upon all messages in all folders that it checks?

To be clear, I'm talking about messages that are already marked as deleted, and which don't show up in the wanderlust summary buffer. But they contribute to the total message count, because the other email client(s) haven't properly expunged them after deletion. My goal is to get wanderlust to expunge all these deleted-but-not-yet-expunged messages, so that they don't contribute to the total message count.

I haven't been able to find the WL function(s) necessary for performing this expunge.

Thank you in advance.


texts:
During idle time with run-with-idle-timer I parse text around a point and update header-line-format.

Unfortunately I can't see update to header line unless I type any key. So I should trigger redisplay.

With (redisplay) header line isn't updated. With (force-window-update) it is updated.

I am not sure what function is appropriated for my usage scenario. There are also redraw-frame and redraw-display and possibly many others.

What function is more efficient in performance?


texts: Adding table headings to #+RESULTS: tables

texts:
I'm using org-babel to generate a result I want to export in my table. However I can't find a way to easily control the heading of the table. At the moment the best I can manage is echo'ing some CSV data in my SRC. For example:

#+name: size-of-tcg
#+BEGIN_SRC sh :dir ~/lsrc/qemu/qemu.git/ :results output table :exports results
EXCL_SPEC='-and -not -iname "kvm*" -and -not -iname "gdb*" -and -not -iname "machine.c"'
echo "arch, language, lines of code"
eval find target-i386/ -xtype f ${EXCL_SPEC} > /tmp/cloc-files
cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d"," -f2,5 | sed s/^/i386,/
eval find target-sparc/ -xtype f ${EXCL_SPEC} > /tmp/cloc-files
cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d"," -f2,5 | sed s/^/ppc,/
eval find target-arm/ -xtype f ${EXCL_SPEC} > /tmp/cloc-files
cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d"," -f2,5 | sed s/^/arm,/
echo " , Total, "
#+END_SRC
#+CAPTION: TCG Code for various target-*
#+ATTR_HTML: :border 2 :rules all :frame border :width 90%
#+RESULTS: size-of-tcg
| arch | language     | lines of code |
| i386 | C            |         17032 |
| i386 | C/C++ Header |          4086 |
| ppc  | C            |         10483 |
| ppc  | C/C++ Header |           834 |
| arm  | C            |         28941 |
| arm  | C/C++ Header |          1962 |
|      | Total        |         63338 |
#+TBLFM: @8$3=vsum(@2$3..@7$3)

Is there a better way to do this?


texts:
I have been using OS X forever. I have been using Emacs forever. I currently use the MacPorts Emacs.app and do (server-start) in my .emacs file. I can't get emacsclient going:

> which emacsclient
/opt/local/bin/emacsclient
>  emacsclient ~/.emacs
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor.  Please use:

        --socket-name
        --server-file      (or environment variable EMACS_SERVER_FILE)
        --altstrong texternate-editor (or environment variable ALTERNATE_EDITOR)

Suggestions?


texts: I have auto-fill mode enabled for text documents, how do I automate fill-region when rewriting?

texts: I have auto-fill mode enabled for text files, and when I edit text I often have to run fill-region within the selected area to make it look nice again. Is there a way to automate this, or to make Emacs stricter when it comes to editing and creating sentences that go past the 80-column boundary?


texts: Prompt for inserting label when using theorem style environments in latex

texts:
When inserting the environment equation (by C-c C-e equation) in latex-mode, emacs shows a prompt to insert a label. It is desirable to have the same prompt for a theorem-style environment like lem defined in the document. When I do C-c C-e lem, the environment lem is correctly inserted, but a prompt for setting the label does not appear.

What is the procedure in order to have this prompt?

\documentclass{article}
\usepackage{amsmath,amsthm}

\newtheorem{thm}{Theorem}
\newtheorem{lem}[thm]{Lemma}
\begin{document}
\begin{lem}

\end{lem}

\begin{equation}
  \label{eq:1}

\end{equation}
\end{document}


texts: How can I use calc to convert in orgmode table

texts:
I am trying to use calc convert in an org mode table.
The gnu manual suggests
$c/$1/$cm
So in my table I tried (for column formula
=$c/$1/$cm also tried =$1/$c/$cm, =$1/$m/$cm etc
Which produces #ERROR. Ideally I would like to convert rpm to rad/s, but converting any units for now would be great.
My data is a float with no units in the cell fyi.
Example
|  rpm | rads   |
|------+--------|
| 9500 | #ERROR |
|   95 | #ERROR |
|   95 | #ERROR |
#+TBLFM: @2$2=$1/$rpm/$rad/s::@3$2=$cm/$1/$m::@4$2=$1/$cm/$m

(row 1 would be the ideal behaivor, but id be happy if i could get row 2 or 3 to work)


texts: Configure org-pdfview and pdf-tools to open at page

texts:
I would like to have emacsclient as my default application for opening pdf-files, when openning them from within Emacs, based on a similar post emacsclient opens a file and does eval simultaneously. Moreover I'd like the ability to jump to a specific page in that file, when the file is opened in an org-mode buffer where file-path::pg e.g. [[file:~/myfile.pdf::2][pg 2 of My File]], opens the pdf file on the desired page, when invoking C-c C-o or org-open-at-point.

I'd expect the following in my init.el to effect the desired result:

(setq org-file-apps '(("\\.pdf::\\([0-9]+\\)\\'" .
                      "emacsclient -e '(progn
                                          (find-file \"%s\")
                                          (pdf-view-goto-page +%1)
                                       )'"
                       )))

The problem is that on execution,find-file \"%s\", the double quotations are not escaped and do not show up in the command that is actually run. i.e. I get find-file /path/to/file instead of find-file "/path/to/file"

Why are the escaped " being ignored and how do I escape them so that they wrap around the %s when the command is run?


texts: how to get web-mode to ignore alignment in favor of indentation during method chaining?

texts:
when I write code (Javascript, specifically) in a web-mode buffer which chains methods across newlines:

object.foo()
.bar()

web-mode seems to want to align it like this:

object.foo()
      .bar()// hitting enter here will dot-align my code

how can I get it to ignore alignment in this case and instead perform  javascript-mode style indentation like this:

object.foo()
    .bar()// adding the closing paren here will indent code by four spaces

?  web-mode-code-indent-offset is set to 4, which works in all other cases like functions and other blocks, but not here, and nothing else in M-x customize-group web-mode seemed immediately applicable.

I'm using Emacs 26.0 and web-mode 20170131.

thanks!


texts: org-babel uses wrong directory during execution of source blocks (org-compile-file error)

texts:
I'm experiencing a strange error when trying to execute/compile a LaTeX source block in org-babel. A simple example looks like this:

#+NAME: latex1802142321
#+BEGIN_SRC latex :results raw :file latex1802142321.pdf :packages '(("" "forest")) :border 0em :noweb yes :eval no-export :tangle latex1802142321.tex
\Forest{
  [a
    [b]
    [c]]
}
#+END_SRC

Everything works fine with vanilla Emacs (25.3.1, org-mode 8.2). But with my configuration (org-mode 9.1.6), something goes wrong, and the compilation exits with the following messages:

executing Latex code block (latex1802142321)...
Processing LaTeX file c:/Users/timm/AppData/Local/Temp/babel-12124NVL/latex-12124LOf.tex...
org-compile-file: File "c:/Users/timm/AppData/Local/Temp/babel-12124NVL/latex-12124LOf.pdf" wasn’t produced.

I suspect that some part of org-babel is using the wrong directory. In fact, the PDF is generated in the directory of the org-mode file (along all the other temporary files), but not in AppData/Local/Temp/babel-12124NVL/. Really puzzling.

Any idea how I can tell org-babel to use the temporary directory?


texts: Getting electric-pair mode to behave more nicely around existing strings

texts:
Electric-pair-mode always tries to insert a closing delimiter after the opening one if nothing is selected. However, if you're placing delimiters around an existing something that you don't want to select for some reason, this adds another keystroke instead of saving you one.

What's a good way to tell electric-pair-mode to check if the point is adjacent to a non-empty string first, and not bother adding a closing delimiter if so?

(For instance, this is the behavior of RStudio's electric pairs.)


texts:
I use the excellent rainbow-mode to highlight colors in CSS files.

However, this assumes I know what color I want. Are there any color pickers that I can use for CSS editing inside Emacs? Ideally, I'd really like something where I can make colors slightly darker/brighter/redder/greener, like the Firefox color picker:

Alternatively, I've noticed customize-face offers a color picker from a set of 548 colors. Can I use this for CSS?


texts: Android manifest - find launch activity name programmatically

texts:
Is it possible to find the launch class name programmatically? For example, if the manifest is as below:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MyActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity>...</activity>
</application>

The output will be MyActivity.class.


texts: Spacemacs trigger holy mode in major mode

texts: I'm using Spacemacs for clojure development and have gotten used to the vim commands mostly. However, when I start up a Repl I would like to only use holy mode with insert mode. Does anyone know how/if this can be done?


texts: Prepend to block of text, but ignore blank lines

texts:
How to add the string 'export ' to the beginning of each line of this text,
with emacs:

RBENV_VERSION="2.n.0"

AUTHORIZE_NET_API_LOGIN_ID=example
AUTHORIZE_NET_TRANSACTION_KEY=example

# Google Calendar Integration

# Google Calendar
GOOGLE_CLIENT_ID=example
GOOGLE_CLIENT_SECRET=example

# Live Mailchimp keys
MAILCHIMP_API_KEY=example


texts: Omit current and parent directories in Ivy find-file completion

texts:
I'm using Ivy in a fairly standard Spacemacs setup.

When I'm opening a file I'd like . and .. to be omitted from the list of completion candidates. In particular, I'd like to be able to tab through directories with only one entry; right now if I spam TAB in the middle of a long Java path I get a Dired buffer for a directory I don't particularly care about.

E.g., if my current directory is ~/src and I find a file in the following file hierarchy, I'd like C-xC-fjTABTABTABTABBRET to open java/com/example/foo/Bar.java.

ls -R
.:
Makefile java

./java:
com

./java/com:
example

./java/com/example:
foo

./java/com/example/foo:
Bar.java
Quux.java


texts: Combine org nodes in separate files into a single tree recursively

texts:
I want to compose "recipes," consisting of "subroutines" defined as org nodes in separate files, into a single tree.
I can't get the behavior I want because (it seems) the org exporter handles #+INCLUDEs iteratively.
The level of each node relative to the absolute root is not known a priori.
root.org:
* root
#+INCLUDE: sub.org :minlevel 2
#+INCLUDE: sub.org :minlevel 2

sub.org:
* sub
#+INCLUDE: subsub.org :minlevel 2
#+INCLUDE: subsub.org :minlevel 2

subsub.org:
* subsub

When I export to org (C-c C-e O O) I get:
* root
** sub
** subsub
** subsub
** sub
** subsub
** subsub

If I remove all :minlevel 2 I get:
* root
** sub
*** subsub
**** subsub
***** sub
****** subsub
******* subsub

What I want is:
* root
** sub
*** subsub
*** subsub
** sub
*** subsub
*** subsub

Is this possible?


texts: How to load libraries (Lisp files), wherever they are located

texts:
I've been learning how to use modules using the cider-mode source code but I've run into a very basic issue.

The contents of my files are

main.el

 (require 'main-module)

   (main-module-message)

   (provide 'main)

main-module.el

(defun main-module-message ()
  (message-box "this is defined in the module")

(provide 'module)

When I do (load "~/Projects/modules-test/main.el")

It can't sense themain-module.el file kept inside the same directory.

Could you please point to the relevant documentation, I can't seem to find anything useful on require and provide apart from a couple paragraphs.

Thanks


texts: Web-mode javascript indentation for “if” and “for”

texts:
When writing Javascript, I always put curly brackets after if in a new line, like this:

if(a == 0)
{
    ....

But when I do that in web-mode, the default is like this:

if(a == 0)
    {
        ....

Is there a way to fix this?

BTW the same goes with for, but not with function definition.  Version information:

versions: emacs(25.1) web-mode("14.0.13”)

I don’t have this problem in the plain javascript-mode.

Here’s a minimal example:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
  </head>
  <body>
  </body>
  <script>
   var a = 0;
   if(a == 0)
       {
           a = 1;
       }
  </script>
</html>

UPDATE:

As @Scott Weldon in the comments suggested, I tried several things:

I updated web-mode to 14.0.19.  Same problem.
I tried using web-mode in a clean Emacs. Same problem.  What I did was:

I ran emacs -Q.
Then I M-x load-library RET ~/.emacs.d/elpa/web-mode-20160717.1201/web-mode.el to load web-mode.
I then tried the minimal example.


texts: Closing parenthesis on own line unacceptable?

texts:
I've been using Emacs for quite a number of years now, but I only recently stumbled over the coding standards. There it is stated:

  Don't make a habit of putting close-parentheses on lines by themselves; Lisp programmers find this disconcerting.

This is exactly the habit I've built up, since I find the code to be easier to read. I see mixed styles in the packages delivered with Emacs. My question is if this disconcert is common to most elisp programmers.

Edit: Looking at my code, I'm not strictly following this. Then the code would be quite horrible. It's mostly defun, let, if and so forth. But, it seems to be against the grain, so I should probably stop doing this. Cheers for the input.

(Borderline opinion based, but it seems related to closing braces in C++, where it shouldn't be controversial to state that they generally should be on their own lines).


texts:
I am using org-mode to organize my life. I got used to planning with DEADLINE. Additionally, I am using Effort property to predict how much effort that I have to show to finish all tasks.

org-agenda-columns C-c C-x C-c provide good interface to estimate effort in agenda. org-agenda shows today tasks, but it also shows future and overdue tasks at the same view like below in the picture. So, it makes really hard to understand how many hours that I have to spend today because it sums automatically all efforts.

I prepared small customized view to show just today tasks as I wanted, but these tasks are filtered with kind of regexp, so that reason, it's not possible to see next or previous days by using org-agenda-earlier and org-agenda-later

TLDR;

Is there any option to show only today's(not overdue and future) tasks in org-agenda?

Things that can help

Example input:

* Main
** Today 1st task
   DEADLINE: <2017-01-25 Wed>
   :PROPERTIES:
   :EFFORT:   01:00
   :END:
**  Today 2nd task
   DEADLINE: <2017-01-25 Wed>
   :PROPERTIES:
   :EFFORT:   00:30
   :END:
** Yesterday Overdue
   DEADLINE: <2017-01-24 Tue>
   :PROPERTIES:
   :EFFORT:   02:00
   :END:
** Future task
   DEADLINE: <2017-01-30 Mon>
   :PROPERTIES:
   :EFFORT:   00:30
   :END:

My non-interactive filter that shows todays tasks

(setq org-agenda-custom-commands
      '(("d" "daily"
         tags "DEADLINE>=\"<today>\"&DEADLINE<=\"<now>\""
         ((org-agenda-sorting-strategy '(todo-state-down)))
         (org-agenda-overriding-header "TODAY tasks"))))

Example Interactive agenda-view that shows just A priority

(add-to-list 'org-agenda-custom-commands
            '("f" agenda ""
              ((org-agenda-skip-function
                (lambda nil
                  (org-agenda-skip-entry-if (quote notregexp) "\\=.*\\[#A\\]")))
               (org-agenda-ndays 0)
               (org-agenda-overriding-header "Today's Priority #A tasks: "))))


texts: How to store a buffer in a variable so that the value of the variable isn't influenced by the fate of the buffer?

texts:
Say I'm in a buffer named init.el and I run
(setq mybuffer (current-buffer))

If I evaluate mybuffer I get #<buffer init.el>. Now I kill this buffer and evaluate mybuffer again. Emacs returns #<killed buffer>. I'd like it to return #<buffer init.el> again, instead.
The reason for this is that I use a variable to store a buffer I want to switch back to, and I'd like to be able to switch to it even after killing and reopening it.
I'd like to avoid storing with buffer-name and retrieving with get-buffer so as to deal only with buffer objects.


texts:
I just started using emacs last week and everything is going well so far. I am using tramp to edit remote files as follows:

C-x C-f
/ssh:user@server:/file/to/edit

I login to the server using an ssh key, so no password is needed. Therefore I don't do anything special to start tramp and nothing has been added to my .emacs file, I simply type the above in my local emacs and it works.

The files im editing are mostly python (ie: plain text *.py files) and for the most part everything works correctly. However when I try to open some files they don't open and the following message is displayed:

gzip: stdin: unexpected end of file

Is there any way to get around this issue?

UPDATE: As suggested in the comments I enabled (setq tramp-verbose 6). The tramp debug buffer is huge (thousands of lines) so I have tried to pick out the parts that appear to be important or where some sort of error is mentioned, hopefully that will aid in figuring out what is happening:

16:11:29.124528 tramp-sh-handle-file-local-copy (3) # Encoding remote file `/ssh:myuser@myserver:/path/to/python/file.py' with `(gzip <%s | base64)'...done

16:11:29.130875 tramp-sh-handle-file-truename (4) # Finding true name for `/ssh:myuser@myserver:/path/to/python/file/'

16:11:29.131565 tramp-send-command (6) # \readlink --canonicalize-missing /path/to/python/file/ 2>/dev/null; echo tramp_exit_status $?
16:11:29.376133 tramp-wait-for-regexp (6) #

16:11:33.245252 tramp-sh-handle-file-local-copy (3) # Decoding local file `/tmp/tramp.4885Mau.py' with `(lambda (beg end) (base64-decode-region beg end) (let ((coding-system-for-write (quote binary)) (coding-system-for-read (quote binary))) (apply (quote call-process-region) (point-min) (point-max) (car (split-string gzip -d)) t t nil (cdr (split-string gzip -d)))))'...done
16:11:33.249827 tramp-call-process (6) # `chown 1000:1000 /tmp/tramp.4885Mau.py' nil nil
16:11:33.252963 tramp-call-process (6) # 0
16:11:33.255820 tramp-handle-insert-file-contents (3) # Inserting `/ssh:myuser@myserver:/path/to/python/file.py'...done

///b47a60d20b86781fc5d02f0fac35ec59#$16:11:34.975322 tramp-send-command-and-check (1) # File error: Couldn't find exit status of `( (test -e /path/to/python/file.py || test -h /path/to/python/file.py) && \stat -c '(("%N") %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 "%A" t %ie0 -1)' /path/to/python/file.py || echo nil)'

The last line appears to be the actual error.


texts: Export all org-mode sections as Beamer frames?

texts:
Is there a way to have all of my Org-mode sections export as Beamer frames? For instance, if I have a document like

* A
** B
** C

then I would like a slide for each of A, B, and C. Setting H:2 gives me slides for the latter two, and H:1 gives me a single slide for all three. I've tried setting BEAMER_env: frame on every single heading, but org-mode complains: 'Wrong block type at a headline named "B"'. Is there another way of achieving this slide structure?


texts: How to avoid redundant output from inline orgbabel code?

texts:
When using #Begin_Src R blocks one can change the code in blocks and then rerun all the code blocks in a document. Great.

However, if one does this with inline src, such as, src_R[:session *myRSession* :exports results :results raw value]{length(unique(someDataFrame$SomeVariable[someDataFrame$conditionVariable == "1"]))}  one will get an output as text following this, e.g. 12. If one repeatedly evaluates all the code blocks in the file one gets an ever growning string of text "12 12 12 12 ..." Which results in one having to go in manually afterwords to clean it up.

The challenge is that in using orgmode and orgbabel to practice reproducible research by writing a technical manuscript one can have a lot of these inline statements (e.g. for every statistical test, p-values, degrees of freedom and so on).

Has anyone solved this, or have any suggestions? I have used knitr with an .Rtex file as an alternative. While this solves the in-line issue it has it's own challenges, and ideally I would like to settle on one markup format for all papers that blend code with text (and would prefer that that markup language be orgmode).


texts: Can the prefix of a key-sequence have an effect?

texts:
I am writing a small window navigation and manipulation package.  Windows are numbered very much like WindowNumberingMode.

To make this concrete I have a series of commands:

"C-, 1"   ; Move focus to (select) window #1
..        ; ..
"C-, 9"   ; Move focus to (select) window #9
"C-, m 1" ; Move current buffer and focus to window #1
..        ; ..
"C-, m 9" ; Move current buffer and focus to window #9
"C-, x 1" ; Exchange current buffer and focus with window #1
..        ; ..
"C-, x 9" ; Exchange current buffer and focus with window #9
..        ; ..

At the time that I type "C-," I would like to offer visual prompts (similar to switch-window):

Can I do this and continue collecting the remainder of my key-sequence?  Do I need "C-," to switch to a new minor-mode?


texts:
Is there a way to make eshell behave better? By default printenv TERM returns dumb. For example brew often complains about the terminal type and causes eshell to "jiggle" while the progress bar is showing.

This doesn't happen in term. I suspect this is because TERM=eterm-color.

I know I could just add brew to eshell-visual-commands, but are there any ways of making eterm-color work in eshell.

Here's the video of brew behaving weirdly. Unfortunately I couldn't reproduce the error mentioned: https://www.youtube.com/watch?v=XFhM_ToLuaQ


texts:
Emacs defines a fair variety of objects that can be bound to keys, with e.g. global-set-key. (The canonical list can be found here).

I would like to simulate the invocation of a keymap entry. For example, I would expect:

If the object is a command, the command is run,
If the object is a keyboard macro, it is replayed,
etc.

What is the simplest way to do this?


texts: Is there a way to get a Unicode character by name?

texts: Is there a way to get a character by name (e.g. GREEK SMALL LETTER LAMBDA) instead of by code point (\uX3BB)?


texts: Shifting org headlines in evil insert state

texts:
With the org-evil package, normal state > on a headline executes
org-evil-demote, but on normal text it executes evil-shift-right.  Two
questions:  (1) How does this work?  (2) It would be nice (and probably more
appropriate?) if a similar behaviour were bestowed on insert state C-t, and
correspondingly on C-d (H-t and H-d in my configuration), such that
evil-shift-right-line and ...-left-... would demote and promote headlines
when point is on headlines.  How might one achieve that?


texts: How to turn the result returned by `org-sbe an-src-block` into list (of lists)?

texts:
In MWE.org, the source blocks list-files, summarize-files-1, and summarize-files-2 are defined to summarize files.
The list-files source block gives the filenames. The summarize-files-1 and the summarize-files-2 source blocks use the filenames and loop on them. The summarize-files-1 source block calls list-files in its BEGIN_SRC, while the summarize-files-2 source block calls list-files using org-sbe. The summarize-files-? source blocks are called within subheadings where the :dir header-arg is defined.
There are three #+CALL: to hopefully clarify my problem.

The first #+CALL: summarize-files-1 does nothing.

The second #+CALL: summarize-files-1[:dir SectionA] does not propagate its header argument to its call of list-files in its BEGIN_SRC.

The third #+CALL: summarize-files-2[:dir SectionA] does propagate its header argument, but gives wrong-type-argument listp, indicating that the result returned by org-sbe in summarize-files-2 has to be manually parsed into list (of lists). If the assumption is true, could you suggest the solution ? Do I have to manually scan the result for delimiters ? :D

Directory tree
avatar@localhost:~/emacs-org-test/MWE$ tree
.
├── MWE.org
└── SectionA
    ├── File-a
    ├── File-b
    └── File-c

MWE.org
#+NAME: list-files
#+BEGIN_SRC sh :results table
ls
#+END_SRC

#+NAME: summarize-files-1
#+BEGIN_SRC emacs-lisp :var files=list-files()
(let (all-summary)
   (message "files is cons cell %s" (consp files))
   (message "files is atom object %s" (atom files))
   (message "files is list %s" (listp files))
   (dolist (file-summary files all-summary)
      (setq file-summary (append file-summary '("property X")))
      (setq all-summary (cons file-summary all-summary)))
   (reverse all-summary))
#+END_SRC

#+NAME: summarize-files-2
#+BEGIN_SRC emacs-lisp
(let (all-summary)
   (let ((files (org-sbe list-files)))
      (message "files is cons cell %s" (consp files))
      (message "files is atom object %s" (atom files))
      (message "files is list %s" (listp files))
      (dolist (file-summary files all-summary)
         (setq file-summary (append file-summary '("property X")))
         (setq all-summary (cons file-summary all-summary))))
   (reverse all-summary))
#+END_SRC

* Project

** Section A
   :PROPERTIES:
   :header-args:    :dir SectionA
   :END:

#+CALL: summarize-files-1

# nothing happens

#+CALL: summarize-files-1[:dir SectionA]

#+RESULTS:
   | MWE.org  | property X |
   | SectionA | property X |

#+CALL: summarize-files-2[:dir SectionA]

# Expected results:
   | File-a   | property X |
   | File-b   | property X |
   | File-c   | property X |

# Error
    Debugger entered--Lisp error: (wrong-type-argument listp "((\"File-a\") (\"File-b\") (\"File-c\"))")
      car("((\"File-a\") (\"File-b\") (\"File-c\"))")

Error:
Debugger entered--Lisp error: (wrong-type-argument listp "((\"File-a\") (\"File-b\") (\"File-c\"))")
  car("((\"File-a\") (\"File-b\") (\"File-c\"))")

Update: One workaround is using read-from-string as suggested here and here


texts: Emacs: How to open new frame on a second screen in windows

texts:
I use two screens and windows 10, and want to open a new emacs frame on the other screen than the one I use. How do I do this?

Preferably, I want the new frame made to be maximized in size.

I have tried make-frame-on-display but this function asks for display name that seem not to be defined on my computer.


texts: Don't fill minted environments in AUCTex

texts: When running M-x LaTeX-fill-environment I don't want code in a minted environments to be formatted. I tried adding minted to LaTeX-fill-excluded-macros but that didn't have any effect on the filling. Any ideas on how to exclude certain environments from the command?


texts: Cannot open .po files: "Wrong type argument"

texts:
Whenever I try to open .po (Portable Object) files in emacs, I get a "find-file-noselect-1: Wrong type argument: arrayp, nil" error and the file is not displayed. However, if I change the file extension to something else (like .txt), it opens in emacs fine. It seems as though emacs is trying to run the file because of its extension instead of just display it.

How can I get emacs to simply display .po files?

As a possibly relevant side note, whenever I execute M-x po-mode, it fails with the error "Cannot open load file: po-mode."


texts: Mirrors produce spurious indentation under mma-mode

texts:
NB:  This problem seems to be limited to mma-mode (for Mathematica).

For example, suppose I define a snippet like this:

# key: test
# name: test
# --
$1
$1

Then, I test it (with C-c C-t).  After I type the first character (x), my terminal looks like this (the ▮ indicates the position of the cursor).

x▮
  x

Note that a couple of spurious spaces were added in front of the mirrored x.

This behavior continues with every additional keystroke, as long as mirroring is taking place:

xy▮
    xy

It happens even if the keystroke is for a backspace:

x▮
      x

As I said at the beginning, I see this problem only with mma-mode.

Now, mma-mode is not maintained, AFAICT.  Therefore, the most I can hope for is some workaround.

Any ideas on how I could prevent the addition of spurious spaces before mirrors?


texts: How to count all of the windows in a frame?

texts:
Just as the question stated, I would like a function that would count of the windows that are currently being shown in that frame.

So this:

+--------------+-------------+
|              |             |
|              |             |
|  *scratch*   | *Messages*  |
|              |             |
|              |             |
|              |             |
+--------------+-------------+
|           *Help*           |
|                            |
+----------------------------+

Would return => 3

I started a function below:

(defun count-windows ()
  "Count how many buffers are currently being shown."
  (interactive)
)


texts: sub shell does not open on the same window I want

texts:
I have a little issue, not too big but a little annoying.

Suppose I open 3 windows in my Emacs GNU like this:

Once I position myself in any window (the largest one, in this screenshot) and press/type M-x shell, the sub shell opens in the next window, which is in this case the first one.

I wonder why this happens and how to fix it?


texts:
I am using a tag :Anrufe: in my org files to mark calls I have to make. Some are regular calls (each Tuesday for example) and others have a specific date.

I have created an org-agenda-custom-commands entry in my config using tags-todo which gives me all calls which are not DONE, i.e. also those which are scheduled for next week. Is there a way to limit the display to the calls which are due today?

EDIT

I have tried already to use org-agenda-span but it seems to have no effect on tags-todo.

(setq org-agenda-custom-commands
      '(("h" "Was liegt heute an?"
         (org-agenda-span 'day)
         ((tags-todo "Anrufe"
                     ((org-agenda-overriding-header "Anrufe")
                      ))))))

(setq org-agenda-custom-commands
      '(("h" "Was liegt heute an?"
         ((tags-todo "Anrufe"
                     ((org-agenda-overriding-header "Anrufe")
                      (org-agenda-span 'day)))))))


texts:
A buddy and I are wanting to start writing emacs packages specific for use in our company.  (Trust me, nothing we write will be of much interest to anyone outside -- it's integration with internal tools.)

We'd like to make package installation and maintenance as easy as possible and we think this means integration with package.el.  What do we need to do to set up a repository for such use?


texts:
I recently saw that a variable org-display-remote-inline-images was added to Org mode. This is a huge one for technical documentation, but sadly I was not able to get it to work. I tried cache and then download value.
Workflow:

Add [[https://URL-to-some-image.png]] to the document. (I tried also jpg and svg.)
M-x org-toggle-inline-images

Am I missing something? I saw something with imagemagick in the diff-patch, imagemagick is installed on the system.


texts: What parameter in orgtbl-to-latex to set column width?

texts:
I am trying to set the alignment width of columns in latex. I am using orgtbl's orgtbl-to-latex
I want to override the resultant
\begin{tabular}{lllll}

to something like
\begin{tabular}{rlccp3 cm)}

What is the argument of the translator function orgtbl-to-latex that do that?


texts:
Is there a nice way to bind Emacs and Grammarly. This is what I wrote to myself. A very simple plugin that helps you to send a marked text to Grammarly. It is a very simple plugin, is there a better way?

https://github.com/mmagnus/emacs-grammarly


texts: How to delete a LaTeX macro while preserving its text content?

texts:
In TeXStudio by hitting ALT+DEL in a LaTeX macro like this \macroname{content} while the cursor stands just before the first { will result in deleting all that except its content (as shown below).

Put the cursor (point) just before the first curly bracket:

Hit ALT+DEL and you get:

How to achieve this in Emacs?

Update
According to T.Verron's clarification there is a problem with C-c C-f C-d as it complains from error of unbalanced parenthesis when executed within some macros in LaTeX. Consider the below example:

throws this error:
 up-list: Scan error: "Unbalanced parentheses", 8074, 1. \textenglish{} belongs to polyglossia package.

How to get rid of this caveat?


texts: Neotree to show functions and classes within each script

texts: Is there an existing feature which is capable of showing the functions and classes within each script in the neotree buffer, in a similar style as to how you can expand the directories' drop down list to show the files in each directory?


texts:
How can I skip to next heading in org-mode?

Say This is my org-file, pipe indicates the cursor:

* Top
** Apple|
** Banana
** Cherry

I'd like to run a command and have my cursor now be here:

* Top
** Apple
** Banana|
** Cherry


texts:
From Windows 10, how can I call an Emacs instance residing on a Windows 10 WSL 2 Linux install, passing it a given file to visit?
So far, I've done this:
On my WSL 2 Linux, I've created a script called runemacs.sh which I keep in ~/bin/
It sets some needed environment variables, to make libgl happy and to tell Emacs where my Windowds 10 X server is.  It looks like this:
#!/bin/sh

export LIBGL_ALWAYS_INDIRECT=1
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0

setsid emacs $1

I can then open a graphical Emacs client from Windows 10 using a command like the following from a Windows Powershell or Command prompt:
wsl -e /home/ld/bin/runemacs.sh

This brings up the Emacs graphical client on my windows desktop.
What I can't do, is then tell Emacs what file I want to edit.  If I have a file named test.txt on my Windows 10 file system for example, I can't then run this to open that file in Windows:
 wsl -e /home/ld/bin/runemacs.sh --file=test.txt

It makes sense why this wouldn't work.  I am basically telling Emacs to open test.txt on the WSL 2 Linux install.  But this is as far as I've been able to figure out how to go myself.
How can I tell Emacs which file to edit?
UPDATE 1: I was able to get much further from Tobias's help.  But I am still left unable to ultimately call wsl's emacs from Windows using 'wsl' combined with 'wslpath'.
I can call wslpath directly from wsl and get a correctly formatted path by doing the following from Windows:
PS C:\> wsl -e wslpath -u "d:\lorddevi\Documents\OpenBSD-Notes.md"
/mnt/d/lorddevi/Documents/OpenBSD-Notes.md

The 2nd line there being the output.  Which, if I could pass to emacs on wsl, it would open fine.
However, I can't use command expansion quotes ( `` ) that I would normally use in a Bash script or on the command line, but can't from windows.
If I try to perform that expansion by creating a bash script on WSL in my homedir, and calling it from Windows, the slashes get trimmed from the pathname for some reason.
Such as:
PS C:> wsl ~/bin/wslemacs.sh d:\lorddevi\Documents\OpenBSD-Notes.md
/mnt/d/lorddeviDocumentsOpenBSD-Notes.md
I can't use -e here as I normally would and still call a bash script I guess.  I tried and it just quietly dies.
So I've tried everything at this point that I can think of to get wslpath to work for me.  I am SO close.
If I could either:

Use `` command expansion quotes for the wslpath call I could make this work.

Or if I could call my 'wslemacs.sh c:\pathto\file.txt' script with windows' wsl.exe command I could also get this working I think.

But neither work, and i am once more lost. :(


texts: How to deal with packages when manage .emacs.d file with version control system?

texts:
I'm trying to use git to manage my .emacs.d directory. I occur this problem:

Some package files are already managed by package-tools such as el-get,package.el via git.

If I add them into my git repository, I met the submodule problem, which makes things complex.
If I exclude these package files, when I sync back to another computer, I have to manually install all the packages.

How to solve this dilemma?

modified:   el-get/ace-jump-mode (untracked content)
modified:   el-get/ace-window (untracked content)
modified:   el-get/dash (untracked content)
modified:   el-get/f (untracked content)
modified:   el-get/flycheck (untracked content)
modified:   el-get/fuzzy (untracked content)
modified:   el-get/s (untracked content)


texts: Can't paste(yank) selected region by multiple-cursor

texts:
Is it possible to copy/paste region.

I whant to copy city's name from the next text.

Here text:

000 111 222 key=Paris, 555 666
111 222 key=Berlin, 555 666
1111111110 111 key=Toronto, 555 666
222222222 111 222 key=London, 555 666

To do this I use Multiple cursors:  https://github.com/magnars/multiple-cursors.el

here steps:

Select key

M-x mark-all-like-this

M-x mark-all-line-like-this
C-M-SPC

Copy selected region to kill ring by M-w
Move cursor after text and paste (yank) by C-y

And here result:

As you can see it paste (yank) only first word (Paris). Why it not paste all other selected word (Berlin, ...) ?


texts:
I am working with some python code and using C-c C-c to run one specific buffer while other python source files are open. As soon as it is launched, the other buffers are closed. This is highly irritating. I have to resplit the buffers (C-x 3 etc) after every run.
I also use Emacs for LaTeX editing, and typsetting a document (C-c C-a) does not close all buffers. So, this is not an Emacs specific "feature". So, it is either python-mode that is perversely designed to do this, or my .emacs has some stuff in it that should not be there. Here are python relevant contents:
(setq python-shell-interpreter "python3")
(autoload 'python-mode "python-mode" "Python Mode." t)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))


texts: Find the last selected frame on a given display

texts:
I want to know which frame on a given X11 display was most recently selected. In fact, I want to know which frame that is mapped on the current desktop was most recently selected.

I can tell what display a frame is on with the display frame parameter, and I can enumerate all the frames on the same display as a given frame with next-frame. I can tell whether a frame is mapped with the visibility frame parameter. I can also call visible-frame-alist to list visible frames. But none of this helps me know which of these was most recently selected.

If the most recently selected frame is on the display I'm interested in, the answer is selected-frame. But what if it isn't?

How can I list all the frames (or all the frames on a given display) in the order in which they were last selected?

I want a solution that works in GNU Emacs ≥23. Ideally this should work for all supported display types, not just X11.


texts: Syncing org files under version control and MobileOrg

texts:
I have a setup in which I keep my .org files in a git repo, with one fork in my laptop and other in my office computer (whose filesystem I can access remotely always). I recently set up MobileOrg in my phone (to work with my laptop) and am loving it. I am using Dropbox for synchronization. I would like to also be able to pull/push from my phone from my work computer. What is the best way of setting this up?
I would normally just use the same Dropbox folder in my work computer and link the corresponding org folder. However, I am worried about conflicts when later merging, pulling, pushing between the original forks, after MobileOrg has changed both. Will git and MobileOrg be able to graciously handle these?


texts: What does translation-table-for-input in function zap-to-char

texts:
I am reading the 8.1.2 The Body of zap-to-char of Elisp Introduction
The body of zap-to-char
 (if (char-table-p translation-table-for-input)
     (setq char (or (aref translation-table-for-input char) char)))
 (kill-region (point) (progn
                        (search-forward (char-to-string char) nil nil arg)
                        (point)))

What does the variable translation-table-for-input do here?
Its default value is 'nil` by my emacs setting.


texts: How to modify the jump character color displayed by evil-avy-goto-line?

texts: The color of the jump character displayed by evil-avy-goto-line is somewhat blurred, which causes me to change the color of the displayed character or modify the color of the background strip of the character.


texts:
The terminal interface to Emacs is marvelous and I like how it handles parentheses.
I have two questions as I'm trying to move to Emacs as both a writing and coding environment.
I installed a minimal Emacs distribution that uses Evil keybindings. My muscle memory is used to Vim and somewhat to CUA. Using Evil I feel fairly productive right away.
Question 1) Is there a balance to learning pure-Emacs keybindings vs. a 'distribution' or keybinding package? Do you lose out on Emacs way of doing things? Does this also make following documentation more difficult?
Question 2) Using Emacs as a plain text writing environment, it seems that the editor allows infinitely long lines with no CR or \N. Is there a way to get **hard-line returns ** automatically (say at 80 or 100 characters)? I've been able to fix this in some editors, but I can't figure this out with Emacs.
My work-around at the moment is to use the par or fmt utility after saving the file.


texts: How can I make nrepl-ritz-jack-in work remotely over TRAMP / Emacs

texts:
What I want:

I have a clojure program on a remote site, let's call it mccarthy.
What I want to do is connect to a nrepl-ritz from my laptop, preferably using nrepl-ritz-jack-in.  The jack in works fine for a local program, but doesn't seem to connect to a remote program.

Attempt 1

C-xC-f on /mccarthy:code/program/project.clj

(require 'nrepl-ritz)

M-x nrepl-ritz-jack-in

Result

Emacs appears to hang.  If I go to the *nrepl-server* buffer, I see this:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.flatland.drip.Main.invoke(Main.java:117)
    at org.flatland.drip.Main.start(Main.java:88)
    at org.flatland.drip.Main.main(Main.java:64)
Caused by: java.lang.AssertionError: Assert failed: project
    at leiningen.ritz_nrepl$start_jpda_server.invoke(ritz_nrepl.clj:23)
    at leiningen.ritz_nrepl$ritz_nrepl.doInvoke(ritz_nrepl.clj:95)

(and tons of other lines, too...)

I am using drip on my laptop, but not on mccarthy, so clearly nrepl-ritz-jack-in is not detecting that it's a remote file.  Regular old nrepl-jack-in will work as expected in this case, however.

Attempt 2

I also tried starting an nrepl-ritz using lein on mccarthy:

mattox@mccarthy$ lein ritz-nrepl
nREPL server started on port 42874

From my laptop I forward a port so local 42874 connects to 42874 on mccarthy:

ssh -L 42874:localhost:42874 -N mccarthy

Then, from my local Emacs:

(require 'nrepl-ritz)

M-x nrepl

Host: 127.0.0.1

Port: 42874

This gives me a connection:

; nREPL 0.1.7-preview
user>

So to test it out, I run

M-x nrepl-ritz-threads

It gives me a nice table of threads.

M-x nrepl-ritz-break-on-exception

user> (/ 1 0)

Result

This hangs, but sometimes shows a hidden debugging buffer with some restarts available.  If I tell it to pass the exception back to the program, it never gives control back to the REPL.

I've done plenty of searches but have not been able to get anything more specific than "make sure lein is on your path".  (And I did do that, on both machines...)  Thanks for reading a (I hope not too) long question!

This question was originally asked by MattoxBeckman, but has yet to be answered.


texts: Maybe this is weird, but I don't like how much my tags fill up the side of my org-agenda. This is especially true after I use org-agenda-filter-by-tag to filter down to a specific tag. For example, once I've applied a filter to see only WORK tasks, I'd like to not have the WORK tag show in the agenda view. Is there a way to hide the :WORK: text without hiding items with the WORK tag?


texts: Org mode refile - multiple locations with same name as target

texts:
My ~/.emacs contains the following:

(setq org-refile-targets '((org-agenda-files :maxlevel . 3)))

The structure of the org file is:

* H1
** Same Name
* H2
** Same Name

Now, when I C-c C-w to refile, how do I select H1 -> Same Name or H2 -> Same Name as a target?


texts: Why `(require 'my-package)' is not evaluated from within a `defun' form?

texts:
I have an init.el file with the following line:
(require 'my-1)

The my-1 package is on the load path.

The my-1 defines this function:

(defun my-f ()
  "Hello."
  (interactive)
  (when (featurep 'my-2) (require 'my-2)
    ... some code here ...)

'my-2' is also on the load path.

Now the problem: calling my-f works (i.e. Emacs evaluates the my-1 package), but the feature my-2 is not loaded. If I manually evaluated (require 'my-2) - everything works (this also proves that my-2 package is on the load path).

How do I require my-2 package from within the defun so it gets evaluated?


texts: auto-fill and auto-hscroll interferes, causing unnecessary horizontal scrolling

texts:
When both auto-fill-mode and auto-hscroll-mode are enabled, I often end up with a window that is horizontally scrolled, even though the entire content of the window should fit into an unscrolled window.

For example:

Emacs -Q
M-x toggle-truncate-lines RET
M-x auto-fill-mode RET
C-u 60 x
SPC
C-u 60 y
SPC

After the y:s have been inserted, auto-hscroll correctly scrolls the window so that the point is visible.

However, after the final SPC, the x:s and y:s are on separate lines, each short enough to be visible. Yet, the window still is horizontally scrolled.

Is there any setting or package that would make the window return to it's unscrolled state, once there is no need for it to be scrolled?


texts:
using meta + x then package install I tried installing a theme. I am able to apply it and it looks great... problem is if i restart spacemacs the following happens:

Found 1 orphan package(s) to delete...
--> deleting color-theme-sanityinc-tomorrow... [1/1]

anyone know how to fix this? I tried googling and changing my settings (specially this setting dotspacemacs-install-packages 'used-only)), but nothing seems to help.


texts: org-mode problem when exporting numbered items to odt

texts:
If I export an org mode document to odt that contains a combination of numbered items and paragraphs the exported document does not retain the correct numbering. For example,

1. Question 1
2. Question 2
Text here...
3. Question 3

The exported file, looks like this:

1. Question 1
2. Question 2
Text here...
1. Question 3

These are my org export options:

    (setq org-export-with-section-numbers nil)
    (setq org-export-with-toc nil)
    (setq org-export-with-author nil)
    (setq org-html-validation-link nil)
    (setq org-export-preserve-breaks t)
    (setq org-export-with-broken-links t)

I am running Emacs 27 on Debian 10 and Org mode version 9.1.9


texts: Getting Gnus working on Windows with Gmail

texts:
Setup:

GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32)
of 2015-10-05

Compiled from EmacsW64.

Gnus, using the latest version of Emacs development branch 25.05

Windows 7 x64 bit.

Situation:

Summary:
I had quite serious headaches with trying Gnus to getting working.
I haven't found a solution for the problem yet. Any assistance/ideas/guesses will be appreciated.
I have followed this manual to set up Gnus with Gmail: http://www.emacswiki.org/emacs/GnusGmail

What follows are my experiments and results.

When connecting I get the following messages in the minibuffer:

Opening connection to imap.gmail.com via tls...
Unable to open server nnimap+gmail due to: Unknown service: 993
nnimap (gmail) open error: ‘’.  Continue? (y or n) n
Couldn’t open server on gmail
Warning: Unable to open server nnimap+gmail due to: Unknown service: 993

And when continue

Opening connection to imap.gmail.com via tls...
Unable to open server nnimap+gmail due to: Unknown service: 993
nnimap (gmail) open error: ‘’.  Continue? (y or n) y
Reading c:/Users/ReneFroger/AppData/Roaming/.newsrc.eld...
Generating the cache active file...done
Opening nnimap server on gmail...
Server nnimap+gmail previously determined to be down; not retrying
Opening nnimap server on gmail...failed:
Checking new news...
gnus-setup-news: Wrong type argument: listp, nnimap

Connecting to the same IMAP server with Opera on the same computer succeeds (so there should be no firewall issues).

The nnimap server is defined as a secondary select method:

(setq gnus-secondary-select-methods '(nnimap "gmail"
(nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
(nnimap-server-port "imaps")
(nnimap-stream ssl)))

I found this thread which looked more promising:
http://thread.gmane.org/gmane.emacs.gnus.user/14695

From that thread it looked like the cause of the error message, might be a SSL certificate issue.
So I found the certificates SSL in the cygwin. So I pointed it to there with:

(eval-after-load "gnutls"
'(progn
(setq gnutls-trustfiles '("c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.trust.crt" "c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.crt"))))

I then tried to start gnus, but I got the same issue.
I also read this stackoverflow topic which is not helping me, unfortunately.

I have tried the log levels 1 and 2  by evaluating

(setq gnutls-log-level 1)

and then tried M-x gnus, and when that didn't give anything meaningful,
I evaluated

(setq gnutls-log-level 2)

and then tried M-x gnus, and that didn't give anything meaningful.

This is my full configuration for Gnus, following the manual for setting up with Gmail (http://www.emacswiki.org/emacs/GnusGmail) and trying to solve this issue with Windows

(setq tls-program '("C:/Dropbox/Sys/cygwin_2/bin/openssl.exe s_client -connect %h:%p -no_ssl2 -ign_eof"))

(setq gnus-select-method
'(nnimap "gmail"
(nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
(nnimap-server-port "imaps")
(nnimap-stream ssl)))

(setq smtpmail-smtp-service 587
gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")

(eval-after-load "gnutls"
'(progn
(setq gnutls-trustfiles '("c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.trust.crt" "c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.crt"))))

(setq gnus-secondary-select-methods '(nnimap "gmail"
(nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
(nnimap-server-port "imaps")
(nnimap-stream ssl)))

(setq smtpmail-smtp-service 587
gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")

Note that .profile and .authinfo are already in my home folder, which is also in my path. Any suggestion to debug this further would be appreciated.


texts: prettify-symbols-mode enabled for major mode, but ligatures don't show until toggling prettify on and off

texts:
I'm pretty new to emacs and giving it a shot because it seems to be much better integrated with the OCaml tool chain than any other editor.
Since OCaml uses a lot of symbols, I want to enable ligature support.
If it's relevant, I'm using spacemacs. Here's what I've added to my dotspacemacs/user-config()
  (load "~/.emacs.d/private/local/pragmatapro-prettify-symbols-v0.828.el")
  (add-hook 'tuareg-mode-hook #'prettify-hook)
  (global-prettify-symbols-mode t)

The .el file I'm using is available here for reference and defines prettify-hook.
The strange thing is that after opening a .ml file in Tuareg mode, I can see that prettify-symbols-mode is active, but none of the symbols are converted to ligatures. However, if I toggle prettify-symbols-mode off and then back on, the symbols render correctly.
Has anyone else had this issue or have any ideas how I can get it to work automatically upon opening a the file?
Edit:
So, interestingly enough, after looking again it seems like some sort of symbol replacement is happening, but it isn't happening with the correct glyphs or for all of the patterns defined in the .el file. For example <= is replaced with a reasonable, but incorrect glyph; |> is not replaced at all. After toggling the mode I end up with the correct replacement glyphs.
See the answers section for the solution I came up with.


texts:
I want to read Xref (Find Identifiers References) in Emacs.

When running info C-hi and then Info-menu m, I can not find any Xref topic.
I have helm enabled, so it completes topics on info.
For example, it completes EDE which appears in Maintaining Large Programs, Xref parent page.

How can I invoke Xref help on Emacs info?


texts: How to make "shell-command-on-region" display output as a message on a non-zero exit code?

texts:
I'd like to replace my selection with the output of a program, an annoyance is - when there is an error, the error replaces my text.

Is there a way to check the exit code and only replace the text if it's zero.


texts: Make VC log history to follow file renames

texts: I like to see full file history regardless file renames (and with Java convention class name == file name several refactoring makes following history difficult).


texts: emacs lsp-mode python how to disable certain warnings

texts: lsp-mode complies to PEP8 style guide I guess, but how can I disable certain warnings, e.g. about missing docstrings etc.?


texts: Use a different color theme for eww buffers

texts: I saw this question: How to customize background color for some web pages opened with eww? but this won't work for me. I'm trying to read Wikipedia pages and in many places Wikipedia uses images to render mathematical formulae. When these have transparent background, the appear not to render acceptably (example below). So, I'd like to have white-ish background theme for eww, while keeping everything else with a dark-background theme.


texts: org-mode file-level agenda scheduling and searching

texts:
My current org workflow involves creating a new org file for each meeting I have, which I find very useful for grouping, scheduling and organising my TODOs from any given meeting. I use org-capture to create a new capture from a template depending on the type of meeting.
My default meeting template looks something like this:
#+TITLE: quarterly review
#+FILETAGS: :work:meetings:xyz:

* Agenda
  <2020-10-27 Tue>
- [ ] first agenda item

* Notes

You'll notice two things here:

FILETAGS are used because the tags refer to the entire file rather than a specific heading or TODO item.
The Agenda heading contains a date so it appears in agenda view, since there is no file-level date setting as far as I'm aware.

My goal is to have both of these points apply as file-level settings rather than heading-level. By that I mean when I enter agenda view or tag search, I'd like to see individual .org files appear as search/agenda results, rather than any and each of their headings.
Is it possible to achieve this kind of file-level searching and filtering of org files by date and tag?


texts: Regexp replace to match a string, but not match a superstring

texts:
Let's say I want to replace the string "Vector" by "VectorBase", but there are existing instances of "VectorBase". So I would like to omit "VectorBase". What is an elegant way to achieve this?

An easy way is to do ignore the condition and do the replacement and at the end replace all instances of BaseBase by Base. I'm looking for a better way to achieve this.


texts: Select coding system when opening PDF files

texts:
I am facing an issue when opening PDF files in Emacs. I always get prompted for "Selecting the encoding system (default raw-text)". The prompt comes up twice. The content of the *Warning* buffer is as follows.
These default coding systems were tried to encode text
in the buffer  *temp file*:
  (utf-8-unix (11 . 4194256) (12 . 4194260) (13 . 4194245) (14 . 4194264) (80 . 4194257) (82 .
  4194203) (86 . 4194279) (88 . 4194300) (89 . 4194200) (91 . 4194245) (92 . 4194264))
However, each of them encountered characters it couldnt encode:
  utf-8-unix cannot encode these:           ...

Click on a character (or switch to this window by C-x o
and select the characters by RET) to jump to the place it appears,
where C-u C-x = will give information about it.

Select one of the safe coding systems listed below,
or cancel the writing with C-g and edit the buffer
   to remove or modify the problematic characters,
or specify any other coding system (and risk losing
   the problematic characters).

  raw-text no-conversion

I have the following set in my init.el, so I am unsure as to what more is required.
(setq locale-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-language-environment 'utf-8)
(set-selection-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)

I also have pdf-tools set up.
(declare-function pdf-view-mode "pdf-tools")
(declare-function pdf-annot-delete "pdf-tools")
(declare-function pdf-annot-add-highlight-markup-annotation "pdf-tools")
(declare-function pdf-annot-add-text-annotation "pdf-tools")

(unless (fboundp 'pdf-view-mode)
  (autoload #'pdf-view-mode "pdf-tools" nil t))
(unless (fboundp 'isearch-forward)
  (autoload #'isearch-forward "pdf-tools" nil t))
(unless (fboundp 'pdf-annot-delete)
  (autoload #'pdf-annot-delete "pdf-tools" nil t))
(unless (fboundp 'pdf-annot-add-highlight-markup-annotation)
  (autoload #'pdf-annot-add-highlight-markup-annotation "pdf-tools" nil t))
(unless (fboundp 'pdf-annot-add-text-annotation)
  (autoload #'pdf-annot-add-text-annotation "pdf-tools" nil t))
(unless (fboundp 'pdf-tools-install)
  (autoload #'pdf-tools-install "pdf-tools" nil t))
(unless (fboundp 'pdf-loader-install)
  (autoload #'pdf-loader-install "pdf-tools" nil t))

;; Expensive to load
(run-with-idle-timer 2 nil #'require 'pdf-tools nil t)

(add-to-list 'magic-mode-alist '("%PDF" . pdf-view-mode))

(add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode))

(with-eval-after-load 'pdf-tools
  ;; (pdf-tools-install :no-query)
  (pdf-loader-install) ; Expected to be faster than `(pdf-tools-install)'

  (defvar pdf-annot-activate-created-annotations)
  (defvar pdf-view-resize-factor)

  (setq pdf-annot-activate-created-annotations t ; Automatically annotate highlights
        ;; Fine-grained zoom factor of 10%
        pdf-view-resize-factor 1.1)

  (setq-default pdf-view-display-size 'fit-width) ; Buffer-local variable

  (add-hook 'pdf-view-mode #'pdf-links-minor-mode)
  (add-hook 'pdf-view-mode #'pdf-isearch-minor-mode)
  (add-hook 'pdf-view-mode #'pdf-outline-minor-mode)
  (add-hook 'pdf-view-mode #'pdf-history-minor-mode)

  ;; (add-hook 'pdf-view-mode-hook (lambda ()
  ;;                                 (setq header-line-format nil)))

  )

(defvar pdf-view-mode-map)
(bind-keys :package pdf-tools :map pdf-view-mode-map
           ("C-s" . isearch-forward)
           ("d"   . pdf-annot-delete)
           ("h"   . pdf-annot-add-highlight-markup-annotation)
           ("t"   . pdf-annot-add-text-annotation))

(with-eval-after-load 'saveplace
  (with-eval-after-load 'pdf-tools
    (require 'saveplace-pdf-view nil nil)))

My GNU Emacs version is 27.1 on Ubuntu 20.04. Please suggest how can I suppress or resolve the above annoyance.


texts:
Occasionally I have this ugly red underline in my python code. It seems not related to any flymake error/warnings. Does anyone know why it shows and how it can be removed? Thanks!

I am using latest elpy and emacs (24.4) on Mac OSX 10.9

The problem only occurs occasionally (but very annoying). Now it happens again. Here is the output of describe-char on a SPACE character in red underline region:

             position: 848 of 1960 (43%), column: 6
            character: SPC (displayed as SPC) (codepoint 32, #o40, #x20)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x20
               script: latin
               syntax:      which means: whitespace
             category: .:Base, a:ASCII, l:Latin
             to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
          buffer code: #x20
            file code: #x20 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    mac-ct:-*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1 (#x03)

Character code properties: customize what to show
  name: SPACE
  general-category: Zs (Separator, Space)
  decomposition: (32) (' ')

There are 4 overlays here:
 From 42 to 1961
  semantic             [Show]
 From 400 to 1961
  face                 semantic-unmatched-syntax-face
  semantic             unmatched
 From 517 to 1469
  semantic             [Show]
 From 531 to 1961
  face                 semantic-unmatched-syntax-face
  semantic             unmatched

There are text properties here:
  face                 font-lock-string-face
  fontified            t

[back]


texts: Is there a way to change the unibyte string bytecode output of `byte-compile` to hex?

texts:
Given a byte-compiled function:
(byte-compile (defun factorial (integer)
                "Compute factorial of an integer."
                (if (= 1 integer) 1
                  (* integer (factorial (1- integer))))))
=> #[(integer)
     "\301U\203\0\301\207\302S!_\207"
     [integer 1 factorial]
     3 "Compute factorial of an integer."]

Is there a way to change the unibyte string bytecode to hex (or decimal (any any other which-way to make it more readable))?


texts: When typing, automatically transform SPC SPC into PERIOD SPC SPC

texts:
I would like the period at the end of a sentence to be added automatically when two spaces are typed (similar to how typing works in iPhones).

I use two spaces between sentences, so the transformation I would like to happen would look like this:

b l a h SPC SPC  -->  b l a h . SPC SPC

I plan to use this along with the auto-capitalize mode.

Many thanks!


texts: Find file in a project in a mono-repo like `projectile-find-file`

texts:
My code base consists of a "mono-repo". A single large repository containing a flat structure of projects.
Top
  Project1
  Project2
  Project3
  Library
  Library

I've been using Projectile to navigate this so far, but I'm starting to get to the point where I want to be able to search within a given library or project. I have a function that will return the root of a library or project.
How can I use projectile-find-file, or something like it, within one of these projects?
Work so far
I found the following command (helm-find-1 (my-mono-find-root)) that does something close to what I want. I'd quite like it to ignore some files tho.